One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Adair1
3 years agoExplorer | Level 3
Error send file 150MB
Hi,
I'm trying to upload a file over 150MB, and I'm using api v2 by the client.Files.UploadSessionStartAsync(body: stream) process, and I always get a message:
Native library pre-loader is trying to load native SQLite library "C:\Users\xx\source\repos\ssxx\xxxx\bin\Debug\x64\SQLite.Interop.dll"...
"xxxxxxxxxx" (CLR v4.0.30319: xxxxx): Loaded "C:\Users\xxxxxx\source\repos\xxx\xxxx\bin\Debug\RestSharp.dll". Symbol loading ignored. The module is optimized and the debugger option 'Just My Code' is enabled.
"xxxxx" (CLR v4.0.30319: xxx): Loaded "C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll". Symbol loading ignored. The module is optimized and the debugger option 'Just My Code' is enabled.
"xxxxx" (CLR v4.0.30319: xxxxx): Loaded "C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll ". Symbol loading ignored. The module is optimized and the debugger option 'Just My Code' is enabled.
"xxxxx." (CLR v4.0.30319: xxxxxxx.): Loaded "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms.resources\v4.0_4.0.0.0_en-BR_b77a5c561934e089\System .Windows.Forms.resources.dll". The module was created without symbols.
Thread 0x4120 was closed with code 0 (0x0).
Thread 0x133c was closed with code 0 (0x0).
Thread 0x3c30 was closed with code 0 (0x0).
Thread 0x2234 was closed with code 0 (0x0).
Thread 0x156c was closed with code 0 (0x0).
Thread 0x193c was closed with code 0 (0x0).
Thread 0x3a04 was closed with code 0 (0x0).
Thread 0x44a0 was closed with code 0 (0x0).
Thread 0x3d64 was closed with code 0 (0x0).
Thread 0x1438 was closed with code 0 (0x0).
Thread 0x2b08 was closed with code 0 (0x0).
Thread 0x4674 was closed with code 0 (0x0).
Thread 0x42f4 was closed with code 0 (0x0).
"xxxxxx." (CLR v4.0.30319: xxxxxx.): Loaded "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0_en-BR_b03f5f7f11d50a3a\System .Net.Http.resources.dll". The module was created without symbols.
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll
was closed with code 0 (0x0).
The program "[9984] XXXX" was closed with the code -1 (0xffffffff).
- Greg-DB
Dropbox Staff
A TaskCanceledException can occur if the connection times out. How much data are you attempting to upload in the UploadSessionStartAsync itself? That is, in your "stream" variable? (You mentioned you're attempting to upload a file larger than 150 MB; you should only be sending a part of that in each request though, e.g., in the UploadSessionStartAsync call.)
Also, how long does it take after starting the call before this exception occurs for you? Is there anything that may be interfering with your connection to content.dropboxapi.com?
- Adair1Explorer | Level 3
I'm sending 30 mega, and it takes 20-30 minutes. Transferring takes a while.
the exception has been fixed by adding a timeout to requests.
Using the other batch method, wouldn't the transfer be better and even more agile?
fragment code:
var result = await client.Files.UploadSessionStartAsync(body: stream);
Console.WriteLine("Uploading session id {0}", result.SessionId);sessionId = result.SessionId;
firstShip = false;then open session
ulong offset = Convert.ToUInt64(chunkSize) * Convert.ToUInt64(totalShips);UploadSessionCursor cursor = new UploadSessionCursor(sessionId, offset);
if (readBytes.Length < chunkSize)
{
var filePathInDropbox = new CommitInfo(soucedestin, mode: WriteMode.Overwrite.Instance);
var result = await client.Files.UploadSessionFinishAsync(cursor, filePathInDropbox, null, stream);finish
await client.Files.UploadSessionAppendV2Async(cursor, body: stream);Is something going unnoticed?
- Greg-DB
Dropbox Staff
Thanks for following up. I'm glad to hear you were able to resolve the exception.
I'm not sure I understand your follow up questions though. Can you clarify? Thanks!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,949 PostsLatest Activity: 22 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X 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!