Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
sebbelese
6 years agoExplorer | Level 4
Upload using POST request to temporary upload address returns code 413 even for moderate size files
Hi All,
I have a server on which I generate server-side an upload address using files_get_temporary_upload_link from API v2.
The upload is made client-side with js:
var xhrUp = new XMLHttpRequest();
xhrUp.open("POST", dropboxUploadUrl, true);
xhrUp.setRequestHeader("Content-Type", "application/octet-stream");
xhrUp.onreadystatechange = function() {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
console.log("DONE")
}
}
var form_data = new FormData();
form_data.append('file', file_data);
console.log("Uploading...")
xhrUp.send(form_data);
The files upload successfully for small files (5-6 Mb), but when I try files of ~20 Mb and more, which is significantly under the limit, the upload stops in the middle of the process, with error code 413, then CORS error:
dl.dropboxusercontent.com/apitul/1/kdRXZZ9QqLnEOQ:1 POST https://dl.dropboxusercontent.com/apitul/1/kdRXZZ9QqLnEOQ 413 localhost/:1 Access to XMLHttpRequest at 'https://dl.dropboxusercontent.com/apitul/1/kdRXZZ9QqLnEOQ' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Is there something wrong with my request?
Thanks for any help.
EDIT: sorry, I just see that the same issue was posted 2 days ago:
We've rolled out a fix so these unexpected 413 errors should no longer be occurring.
3 Replies
- Greg-DB6 years ago
Dropbox Community Moderator
Thanks for the report! This is an issue on our side. We're working on it.
- Greg-DB6 years ago
Dropbox Community Moderator
We've rolled out a fix so these unexpected 413 errors should no longer be occurring.
- sebbelese6 years agoExplorer | Level 4
I just tried to upload a 20+ Mb file and it works. Thanks for the quick fix!
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!