Issue Details (XML | Word | Printable)

Key: ZF-6669
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Stanislav Malyshev
Reporter: vincent
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Amazon S3 Stream Wrapper - Upload & Uri

Created: 15/May/09 02:37 AM   Updated: 15/May/09 10:08 AM   Resolved: 15/May/09 10:08 AM
Return to search "Fixed in 1.5.1"
Component/s: Zend_Service_Amazon, Zend_Uri
Affects Version/s: 1.8.1
Fix Version/s: 1.8.2

Time Tracking:
Not Specified


 Description  « Hide

Iam using the S3 Stream Wrapper, but there is no way add a variable scheme to Zend_Uri.

I´ve fixed it very dirty, and add the registerd s3 scheme in Zend/Uri.php.
switch ($scheme) {
case 's3':
$className = 'Zend_Uri_Http';
break;

The curios is , ive 3 upload elements and try to upload 3 files via Zend_File.

very simple:
$uri = Zend_Uri::factory('s3://test-test-b/')
$adapter->setDestination($uri->getUri());
$adapter->receive()

I uploaded 3 files "a_3.png","a_2.png","a_1.png" and all works fine.

But when iam trying to upload these files:
"a 3.png","a_2.png","a_1.png" (look at the space)

I get this exception:

Fatal error: Uncaught exception 'Zend_Uri_Exception' with message 'Invalid URI supplied' in ...library/Zend/Uri/Http.php:156 Stack
trace:
#0 .../library/Zend/Uri.php(135): Zend_Uri_Http->__construct('http', '//s3.amazonaws....')
#1 .../library/Zend/Http/Client.php(261): Zend_Uri::factory('http://s3.amazo...')
#2 .../library/Zend/Service/Amazon/S3.php(366): Zend_Http_Client->setUri('http://s3.amazo...')
#3 .../library/Zend/Service/Amazon/S3.php(150): Zend_Service_Amazon_S3->_makeRequest('HEAD', 'test-test-b/use...')
#4...library/Zend/Service/Amazon/S3/Stream.php(439): Zend_Service_Amazon_S3->getInfo('test-test-b/use...')
#5 [internal function]: Zend_Service_Amazon_S3_Stream->url_stat('s3:// in ...library/Zend/Uri/Http.php on line 156

Same Problem, when iam trying to upload a file named "äpicture.jpg".
I dont know why the class is using the http adapter when iam using a file with a space or an german char.



Matthew Weier O'Phinney added a comment - 15/May/09 06:47 AM

Assigning to Stas.


Stanislav Malyshev added a comment - 15/May/09 10:08 AM

Seems to be duplicate for ZF-6540, both fixed