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

sebbelese's avatar
sebbelese
Explorer | Level 4
5 years ago

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:

https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Uploading-via-get-temporary-upload-link-throws-a-413-Payload-Too/td-p/427176

  • We've rolled out a fix so these unexpected 413 errors should no longer be occurring. 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report! This is an issue on our side. We're working on it.

    • Greg-DB's avatar
      Greg-DB
      Icon for Dropbox Staff rankDropbox Staff

      We've rolled out a fix so these unexpected 413 errors should no longer be occurring. 

      • sebbelese's avatar
        sebbelese
        Explorer | Level 4

        I just tried to upload a 20+ Mb file and it works. Thanks for the quick fix!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,918 PostsLatest Activity: 2 days ago
334 Following

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!