Hi all,
I'm using the api to save a file to Dropbox from node (meteor). My problem is, if I don't first save to disk (node) but directly to Dropbox, the result is a corrupted file. Otherwise, If I first save to node, read, and then save to DB, the file is saved perfect.
In the client (browser) I receive the file from the user and pass this: file.srcElement.result to server (node).
In server, I write the file to disk:
await writeFileAsync(fileName, blob, encoding)
then read it from disk
fileContent = await readFileAsync(fileName);
get my Dropbox token ...
write to Dropbox :
await dbx.filesUpload({
path: fileName,
contents: fileContent,
mode: { ".tag": "overwrite" },
autorename: false
})
Everything works perfect and I can see the file is perfectly written to DB. Nevertheless, I don't want to save the content first to disk, in order to save then to DB.
Can somebody help me undertand what I'm missing here?
Many thanks and bye ...