You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's definitely possible to send a request that uses an HTTP stream.
The problem here is that the SDK could not determine the Content-Length of the request because you passed in a stream. Because there is no Content-Length header and the HTTP protocol being used is HTTP/1.1, the SDK (specifically Guzzle) sent the request with the Transfer-Encoding: chunked header. Because Amazon S3 does not support chunked uploads, you received a 501 response.
You should specify a "ContentLength" parameter in your $s3->putObject() call to tell the SDK the size of the file. Try something like this:
thanks for taking a look! I tried what you suggested (and also added ContentType incase that was needed, but I still can't get it to go through, I am still getting the same error with:
It seems like we might have an issue with this particular scenario, as it seems like the Content-Length is not set properly, even when it's provided. We'll look into this and see what we can do. Sorry it is causing you problems.
This issue is now resolved and the fix will be available in the next tagged release. In the meantime, if you use the master branch of the SDK and the master branch of Guzzle, then you can use non-seekable HTTP streams in your PutObject requests immediately. Here's the related commit in Guzzle: guzzle/guzzle@487250f
Activity
mtdowling commentedon Apr 17, 2013
It's definitely possible to send a request that uses an HTTP stream.
The problem here is that the SDK could not determine the Content-Length of the request because you passed in a stream. Because there is no Content-Length header and the HTTP protocol being used is HTTP/1.1, the SDK (specifically Guzzle) sent the request with the
Transfer-Encoding: chunkedheader. Because Amazon S3 does not support chunked uploads, you received a 501 response.You should specify a "ContentLength" parameter in your
$s3->putObject()call to tell the SDK the size of the file. Try something like this:joehoyle commentedon Apr 17, 2013
Hi @mtdowling
thanks for taking a look! I tried what you suggested (and also added ContentType incase that was needed, but I still can't get it to go through, I am still getting the same error with:
jeremeamia commentedon Apr 19, 2013
It seems like we might have an issue with this particular scenario, as it seems like the Content-Length is not set properly, even when it's provided. We'll look into this and see what we can do. Sorry it is causing you problems.
jeremeamia commentedon Apr 19, 2013
This issue is also duplicated on the AWS forums. We will track the issue here and post the resolution on the forums.
mtdowling commentedon Apr 23, 2013
This issue is now resolved and the fix will be available in the next tagged release. In the meantime, if you use the master branch of the SDK and the master branch of Guzzle, then you can use non-seekable HTTP streams in your PutObject requests immediately. Here's the related commit in Guzzle: guzzle/guzzle@487250f