Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.1
-
Fix Version/s: 1.8.2
-
Component/s: Zend_Service_Amazon
-
Labels:None
-
Tags:
Description
Hi,
ive tested the Amazon_S3 StreamWrapper and this works fine.
But now, i would like to realize a direct Upload to the Amazon Storage, but to Upload a file, Zend_File checks the Destination Directory and this won´t work with the StreamWrapper.
$s3 = new Zend_Service_Amazon_S3(*****)
$s3->registerStreamWrapper("s3");
[...]
$adapter = new Zend_File_Transfer_Adapter_Http();
$adapter->setDestination('s3://test-test-f/');
( The bucket exist, checked with S3Fox. I also grant all rights in the ACL to everyone. )
This throws an exception, that the destination is not a directory.
Did i make a mistake or it is not implemented yet ?
I´ve found the Issue.
There is a Problem with the backslash in the "_getNamePart" function.
I cant use this:
"is_dir('s3://test-test-f)"
cause the index "path" is undefined.
But when i use this:
"is_dir('s3://test-test-f/')"
the function return 2 slashes.
string(12) "test-test-f//" and url_stat wont work.
The main problem, that i cant use is_dir() is, thats the mode is not set. ($stat['mode'] = 0
Quote from cellog at php dot net 13-Apr-2005 04:45 :
"url_stat() must define mode, or is_file()/is_dir()/is_executable(), and any of those functions affected by clearstatcache() simply won't work.
It's not documented, but directories must be a mode like 040777 (octal), and files a mode like 0100666. If you wish the file to be executable, use 7s instead of 6s. The last 3 digits are exactly the same thing as what you pass to chmod. 040000 defines a directory, and 0100000 defines a file. "