Impossible to upload a big file (+200mb)
See original GitHub issueHi,
Following the examples shown in #80 , I got some errors using this implementation
const uploadWithSDK = file => new Promise((resolve, reject) => {
const dbx = new Dropbox({
accessToken: 'mytoken'
});
let fileStart;
let finishBatch;
dbx.filesUploadSessionStart({
contents: file,
close: false,
})
.then(function (response) {
fileStart = response;
console.log('session started');
dbx.filesUploadSessionFinishBatch({
entries: [
{
cursor: {
session_id: fileStart.session_id,
offset: file.length
},
commit: {
path: `/${file.name}`
}
}
]
})
.then(function (response) {
finishBatch = response;
console.log('on finish batch', finishBatch);
dbx.filesUploadSessionFinishBatchCheck({async_job_id: finishBatch.async_job_id})
.then(function (response) {
finishBatch = response;
})
.catch(function (err) {
console.log(err, 'on finish batch check');
});
})
.catch(function (err) {
console.log(err, 'on batching');
});
})
.catch(function (err) {
console.log(err, 'on filestart');
});
});
I got the following errors in chrome, because of the reasons stated in #111
Refused to set unsafe header "accept-encoding"
Refused to set unsafe header "user-agent"
Refused to set unsafe header "content-length"
Response to preflight request doesn't pass access control check:
The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*'
when the request's credentials mode is 'include'.
Origin 'http://localhost:3000' is therefore not allowed access.
The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Currently, the SDK doesn’t allow to pass any request headers so I literally cant use session uploads.
My question is: If it’s doable, how?
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Immediate 'Unable to upload' error for files over 200 MB
Solved: HELP! All of a sudden I cannot upload large files. I can still upload smaller files but anything over 200mb seems to...
Read more >Unable to upload a large file(200MB in size) in WebCenter ...
Hello, I am trying to upload a large file(200MB in size) in WebCenter Content 12c but getting the following error: Error.
Read more >Unable to upload a file of size 200mb to IPFS - Moralis Forum
I'm getting this error when I try to upload a 500MB video. Same code works fine with a smaller one (35MB). On IFPS...
Read more >How To Upload Large Files To Google Drive Quickly - MASV
Learn the best ways to upload to Google Drive large files quickly, including reasons why large uploads to Google Drive can fail. Read...
Read more >i cannot upload large files (i do have space for them!)
I cannot upload large file (like 700 mb movie file ) . at the starting time it is showing 1 minute ... Please...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There might be a better way to solve this but here is how I solved it. It seemed the only way to get Dropbox to not error on a large upload was to upload each part one at a time running the function recursively. I am by no means a Javscript expert but this has been working for us on file uploads as large as 900mb.
If there is a way to make this more efficient or faster would love to know. Especially if the experts at Dropbox have a better way.
Otherwise hope this helps someone.
hi @rymerrick , I have solved the problem, it only involves two steps:
I am using it with 0 problem on my Meteor app.