-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot upload empty files - Missing input parameters #24
Comments
You can't upload empty files. This is forbidden by the following code. Lines 82 to 88 in 6448ddf
The empty object upload is only allowed if the last character is the path separator ( In your use case you could probably detect an empty CSV file and upload a single newline ( |
Thank you, the "cheat" works well. |
I have added this limitation because there was a very common issue where people would forget to initialise the Input object correctly. At the same time uploading zero-length items is an exceedingly rare case. Catching the zero-length case and throwing an exception (which can easily trigger a debug trace if you use any kind of exception handling or even PHP's bog standard error logging) was much more productive than having people trying to hunt down the Input initialisation problem. I am going to label this as “won't fix” since throwing the exception is still more relevant than allowing zero-length uploads. If this changes in the future I will of course revise the code. |
I'm trying to use putObject method to upload small files into my S3 bucket. The non-empty files will get uploaded correctly, while the empty ones will not get uploaded. Is it possible to upload empty files?
Here is my code:
The text was updated successfully, but these errors were encountered: