- Newest
- Most votes
- Most comments
Hi, @niaz.
Could you please check this problem and fix it in SDK
You want to report a bug instead of asking a question?
We can still have a discussion here, but perhaps it would be better to add the product team to the conversation.
The AWS SDK for .NET is issue and version managed on GitHub and the .NET on AWS team is participating.
You can contribute to a quick fix by filing a bug report here.
Additionally, the AWS Developers Slack has a .NET on AWS channel, so we can discuss improvements there as well.
https://twitter.com/dotnetonAWS/status/1620180080377925632?s=20
Hello, First I want to know if the documentation is correct or I am understanding it wrong. What should be the expected behavior from the Upload API. If you could please first make sure the expected behavior then I can submit a bug request. So the question is: Do I need the length and seek capability of the stream when I call PUT to upload an object with stream?
Thanks
@niaz,
Based on your description you want to pass through a file received over HTTP to S3. Naturally, seeking will not be supported because you are receiving a NetworkStream
which streams content in chunks. The entire stream does not arrive at the client all at once. The Stream
or NetworkStream
object may not support reporting its length, but you can still determine the length. Your HTTP client will have received the Content-Length
header and that will tell you the length of the stream. If absolutely necessary, you could wrap the stream with a custom Stream
implementation that has the length from Content-Length
and passes through all other operations to the original stream.
The UploadPart API is for using a MIME-encoded, multipart documentation which is necessary send multiple files at once. Are you trying to send multiple, received files? Your description makes no mention of that. If you're not sending multiple files, why not just use PutObject?
Thanks for the answer.
A wrap stream like you wrote with Content-Length can be used, but this is unfortunately not possible. In some situations, our client does not provide the "Content-Length" to the Web API. The only solution then I see is the intermediate cache. Therefore I asked, if the "Content-Length" property is really required by S3 RestAPI, if not then I can add a bug report for .net SDK.
The other thing related to Seek, there seems to be a bug for multipart upload but the simple object upload works. I have downloaded the code of .net SDK and debugged a bit, this bug I will report.
Yes, we do use multi-part upload. In this case again the client decides, if a stream can contain the length or not. Under normal conditions, the multiple parts of the same file are uploaded simultaneously and the "Content-Length" is also available for me on the server. But in order to use this property I need to change the existing code and all the interfaces...
Thanks,
Relevant content
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 18 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago