You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
DboxDeveloper
8 years agoExplorer | Level 3
Objective C batchUploadFiles gives error: "missing required field 'session_id'" or "Garbage at end."
Hi,
I am getting the error
DropboxBadInputError[{
ErrorContent = "Error in call to API function \"files/upload_session/finish_batch\": request body: entries.cursor: missing required ...
- 8 years agoThanks! This is very helpful. I'm able to reproduce this now. We're looking into it.
We have a rough idea of what's occurring, though not exactly why it's occurring yet. One thing that may be relevant though is that for some calls, you're using `setProgressBlock` and checking `if (totalBytesUploaded == totalBytesExpectedToUploaded` to see if the operation is complete. You should always use the response block (e.g., `setResponseBlock` for most calls, or passed as a parameter for `batchUploadFiles`) to know when the operation completed and then carry on with your next steps.
Please try making that change and let me know if it does or doesn't help. Thanks!
Greg-DB
8 years agoDropbox Staff
Thanks for the report! It looks like there's a good amount of code here, and I won't be able to run it, since it contains things from your app, like `WCPURLHelper`.
Can you isolate just the portion(s) of Dropbox related code that results in these issues so we can look into it? We'd first need to be able to reproduce the issue to investigate it.
Also, note that the latest version of the Objective-C SDK is 3.2.0. If you're not already on that version, please try upgrading to it first.
Can you isolate just the portion(s) of Dropbox related code that results in these issues so we can look into it? We'd first need to be able to reproduce the issue to investigate it.
Also, note that the latest version of the Objective-C SDK is 3.2.0. If you're not already on that version, please try upgrading to it first.
- DboxDeveloper8 years agoExplorer | Level 3
Thanks Greg for helping.
I've edited the code to be easily tested, so you can lift it and put it in your app. All you need to do is:
1) In the documents directory of the iphone app make a photo and call it MainPhoto.db //yes change the extension to .db, this is to repiclicate the db file i transfer in the app
2) Next in the documents directory make a folder called photos, add about 20 or so pngs// you can just use cmd-d to duplicate one photo many times
3)Once you do that you should be able to run the method, this method will have "Garbage at end of file" then further use of this method will cause session_id errors
In addition, I've updated the dropbox api to 3.2 in the app, but the problems still occurs.
Here is the entire code
https://github.com/git-tyl/WineCellarProblemCode/blob/master/problemUploadingDropboxCode.m
- Greg-DB8 years agoDropbox StaffThanks! That's very helpful. We'll look into it.
- Greg-DB8 years agoDropbox StaffI just followed your instructions and was able to run your supplied code, but I didn't get either of these error messages.
There must be some other factor, so can you perhaps plug it in to a sample project that reproduces the issues for you and share that?
Also, in case it matters, what version of Xcode are you using?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 2 hours agoIf 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!