Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Sort of new to web dev in general so forgive me if I don't know what to do. The issue is that in my local project repository. Temporary files are being created. I'm not sure if this is an issue to be concerned with? I worry what will happen after deployment and whether this will cause issues down the line. Are we suppose to just let the host clean the files automatically or are suppose to manually flush the temporary files created after file upload? I plan to deploy on Heroku for my web app.
Here is some code to let you know what is going on. I'm using the Dropbox SDK for Javascript.
Express -> using Formidable / Form as middleware to parse request.
app.post('/form', (req,res)=>{ let success = null; //take the file and send it off to dropbox form.parse(req, (err, fields, files) => { console.log("fields:", fields); console.log("file:", files.myfile); console.log('filename:', files.myfile.name); // if (files.myfile.size > const UPLOAD_FILE_SIZE_LIMIT) if (files.myfile.size<UPLOAD_FILE_SIZE_LIMIT) { dbx.filesUpload({path: "/ReflectionsBucket/" + files.myfile.name, contents: files.myfile, autorename: true}) .then(res=>console.log(res)) .catch(err=>console.log(err)); success=true; } else { success=false; } }); //form.parse //need to add the event when the form ends using form.on('end') form.on('end', ()=>{ if (success) res.send('post successful'); else res.send('file size is too big, needs to be under 150mb'); }); });
I'm afraid we can't be of much help with this unfortunately, as it doesn't seem these files are being produced by Dropbox code.
The Dropbox JavaScript SDK is open source, so you can see what it's doing at the following locations in the code for the 'filesUpload' method you're using, for instance:
The method just uploads whatever content you supply to that 'contents' parameter.
Perhaps the files are produced by your web framework itself, for the files posted in that form to begin with? In that case, I'd recommend referring to the documentation/support for that framework.
Hi there!
If you need more help you can view your support options (expected response time for a 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!