cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upload using POST request to temporary upload address returns code 413 even for moderate size files

Upload using POST request to temporary upload address returns code 413 even for moderate size files

sebbelese
Explorer | Level 4
Go to solution

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...

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

sebbelese
Explorer | Level 4
Go to solution

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    sebbelese Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?