Created
November 22, 2019 07:18
-
-
Save trevorfoskett/c399dc88941f6c9594418f5ae7d17426 to your computer and use it in GitHub Desktop.
Assign a unique filename to each file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
var fileName = file.name; | |
// Assign a unique name (uFileName) to each file (fileName | |
// + randnum)to ensure client will not attempt to use same | |
//set of keys for multiple files of the same name. | |
var uFileName = `${fileName}|${Math.random()}`; | |
// Set temporary storage location in /tmp/ | |
var dest = fs.createWriteStream(`/tmp/${uFileName}`); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment