Hi f-miyu:
I've taken a look at your implementation of the PutStreamAsync method: you are only converting the given stream to a byte array and then you are uploading them using PutBytesAsync.
The thing is that you are using memoryStream.ToArray() which in turn is trying to allocate a huge array if the file to be uploaded is big (and, if you think in media files, it is big almost all the time).
Just wanted you to know that this is happening and it is a common issue
In addition, a suggestion: why not adding a new method to upload a file by providing a the file Uri?
That will be useful for gallery and content:// files if you don't want to copy it to a file to get the path (or there is a way to do it without making a copy? I didn't find a way yet)
Hi f-miyu: I've taken a look at your implementation of the PutStreamAsync method: you are only converting the given stream to a byte array and then you are uploading them using PutBytesAsync. The thing is that you are using memoryStream.ToArray() which in turn is trying to allocate a huge array if the file to be uploaded is big (and, if you think in media files, it is big almost all the time).
Just wanted you to know that this is happening and it is a common issue
In addition, a suggestion: why not adding a new method to upload a file by providing a the file Uri? That will be useful for gallery and content:// files if you don't want to copy it to a file to get the path (or there is a way to do it without making a copy? I didn't find a way yet)