Discuss Dropbox Developer & API
Hi,
I encountered the problem "Error while copying content to a stream" when executing the above code. Is there any way to fix it?
@Rephoto If you wish to optimize your upload process, please refer to the Performance Guide: https://developers.dropbox.com/dbx-performance-guide
That offers some ways you may be able to improve your effective overall upload speed. For example, there are batching and parallelization features you can use.
For instance, as Здравко noted, the default upload session type is "sequential", but you can use "concurrent" to upload file pieces in parallel. That would require you to make some more changes to your code to properly send those pieces in parallel though.
What line is that occurring on? Please print the full exception and stack trace for reference.
I get an error on this line: "await Task.WhenAll(tasks);"
Is there any way fix it?
Thanks
This is another error you may encounter
Thanks for sharing the additional information. It looks like this is related to you trying to start multiple tasks within the loop without awaiting them, leading to the stream being closed (due to the iteration continuing and moving on to the next piece of the file) before it can be used.
Exactly how you structure your code/tasks is up to you, but to get this working I suggest awaiting each append task, instead of using tasks.Add and Task.WhenAll.
Hi @Rephoto,
When you're starting upload session, you use the default type - sequential session, but when actual upload gets on you're trying concurrent upload. Decide what you want actually.
Hope this gives direction.
I want to increase their upload speed, is there any other way? Thanks
@Rephoto, Start concurrent upload session and upload every peace of data in its own context (so no any reference gets lost). 😉
Good luck.
@Rephoto If you wish to optimize your upload process, please refer to the Performance Guide: https://developers.dropbox.com/dbx-performance-guide
That offers some ways you may be able to improve your effective overall upload speed. For example, there are batching and parallelization features you can use.
For instance, as Здравко noted, the default upload session type is "sequential", but you can use "concurrent" to upload file pieces in parallel. That would require you to make some more changes to your code to properly send those pieces in parallel though.
I changed the code and there weren't any errors but the Entries returned all had a status of fales.
Can you tell me where I'm going wrong?
Thanks
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on Twitter or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!