We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
ijunaid8989
7 years agoExplorer | Level 3
too many write operations when uploading files
I am using Elixir wrapper to DropboxAPI to upload files, which is doing simple upload using `files/upload` route. def upload(client, path, file, mode \\ "add", autorename \\ true, mute \\ false) d...
Greg-DB
Dropbox Community Moderator
7 years agoThe 'offset' value is "The amount of data that has been uploaded so far. We use this to make sure upload data isn't lost or duplicated in the event of a network error.".
That is to say, it should be the number of bytes that you have already uploaded so far for that particular upload session. You should keep track of this client-side as you send the file data up to Dropbox.
ijunaid8989
7 years agoExplorer | Level 3
Okay thanks now,
on upload_session/start and then doing upload_session/finish
my file is getting uploaded.
the file was of 37 kbs. which I set in offset in upload_session/finish, but
how upload_session/finish_batch can over all the present sessions? when it only takes one session id? and one one file name?
I can now upload the file to my account using only
upload_session/start and upload_session/finish
would that be enough ? for uploading multiple files at once? to dropbox?
I am actually in a loop which being spawned and sending files to dropbox account.
Now I only need to so session start and in the finish add the file size and that it? would that stop sending me too many write operations message?
- ijunaid89897 years agoExplorer | Level 3
and If I can the append_v2 with close true, it gives me error as
double the offset, it should be, file as 37KBs and it gives an error as offset should be 74
- Greg-DB7 years ago
Dropbox Community Moderator
If you want to commit multiple file uploads at once, and avoid the you should use /2/files/upload_session/finish_batch. That endpoint does not only take a single file name/upload session ID. Its UploadSessionFinishBatchArg.entries parameter takes a list of multiple UploadSessionFinishArg. You can find information on that in the documentation here:
It says "List of (UploadSessionFinishArg, max_items=1000)", indicating that you can supply up to 1000 per call. Each UploadSessionFinishArg should contain the information for a single file and upload session.
When appending data to an upload session, you shouldn't repeatedly send the same data if it's already been successfully sent.
- ijunaid89897 years agoExplorer | Level 3
When I am going to need this append option anyways?
you mean if the file is bigger, I first send some of its kbs and then some of the others?
In case I have a 2MB file? Can I send it once in the first upload session start request. and then Should I still need to do the append? or not?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!