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