ZF-12127: Zend Service Amazon S3 does not close file pointer on stream file upload

Issue Type: Bug Created: 2012-03-29T21:33:30.000+0000 Last Updated: 2012-03-29T21:37:00.000+0000 Status: Open Fix version(s): Reporter: Sukhbir Grewal (ssgrewal) Assignee: Enrico Zimuel (zimuel) Tags: - Zend_Service_Amazon

  • Zend_Service_Amazon_S3

Related issues: Attachments:


The putFileStream() method in Zend_Service_Amazon_S3 does not close the file pointer after method execution is complete. This leads to issues if the code thereafter tries to do other file operations like unlink() the file after it has been uploaded. The issue does NOT happen with putFile() as it does not use a file pointer.

The following leads to a 'Permission denied' warning on unlink() - the file/folder permissions were verified tobe correct. $filePath = 'some_file_path/file.txt'; $s3 = new Zend_Sercice_Amazon_S3($accesskey, $secretkey); $s3->putFileStream($filePath, 'some_bucket_name/file.txt', array(Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ)); //the following line leads to 'permission denied' warning as Zend did not close the file handle after upload to amazon s3 unlink($filePath);


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.