I am running node server on ubuntu. i am using dropbox module in nodejs.(https://www.npmjs.com/package/dropbox)
node -v = v0.10.38
npm -v = 1.4.28
I am using angularjs in front-end to upload file using (https://github.com/danialfarid/ng-file-upload) library. Uploading small files < 25mb works fine. It is uploading to the server and uploading to dropbox. But when file if larger like (50mb). It is giving error.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
RangeError: Maximum call stack size exceeded.
Here are relevant codes which i am using :
var client = new Dropbox.Client({
"key": "XXXXXXXXXXX",
"secret": "XXXXXXXXXXXX",
"token": "XXXXXXXXXXXXXXXXXXx",
"uid": "XXXX"
});
app.all('/test', function (req, res) {
console.log(req.files);
var f = req.files.file;
var dbx_file_stat;
var short_url;
var new_file_name = 'generate file name';
fs.readFile(f.path, function (error, data) {
if (error) {
console.log('read error');
return console.log(error);
}
client.writeFile(new_file_name, data, function (error, stat) {
if (error) {
console.log('write error');
return console.log(error);
}
//stopReportingProgress();
client.makeUrl(new_file_name, {downloadHack:true},function (error,url) {
if (error) {
return console.log(error);
}
res.send("it works");
});
});
});
})
The Large files are uploading to the server but unable to upload on dropbox server.
I did some research . Some suggested to use (https://nodejs.org/api/timers.html#timers_setimmediate_callback_arg). But how to implement. what is causing this problem?
I also tried running app through node --stack-size=320000 app.js
New error came after this ,
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
Segmentation fault