Dynamically changing destination folder name
See original GitHub issueIs it possible to dynamically change the destination folder name depending on the field name? I made a quick test which failed
app.use(multer({
dest: './uploads/',
rename: function (fieldname, filename) {
if(fieldname == 'avatar_file'){
return filename.replace(/\W+/g, '-').toLowerCase() + Date.now()
} else {
return 'avatars/' + filename.replace(/\W+/g, '-').toLowerCase() + Date.now()
}
}
}))
Thanks
Issue Analytics
- State:
- Created 9 years ago
- Comments:21 (5 by maintainers)
Top Results From Across the Web
Dynamic - Destination Folder - Power Platform Community
So, when my destination folder is dynamic, i can move all the folders to the correct library. Solved! Go to Solution.
Read more >How to adjust Dynamic file name save location (Novice)
So in this case, you have to use the "change entire file path" option and you'll need to supply it with a complete...
Read more >Nprinting Dynamic Naming of folders - Qlik Community - 134604
To create different destination folders you can set the user name, folder or subfolder in the folder destination configuration. Best Regards,.
Read more >Pass dynamically generated directory name to Destination ...
Pass dynamically generated directory name to Destination attribute of cffile tag ... The upload works fine if I replace the #session.details.
Read more >2. Get File Names from Source Folder Dynamically in Azure ...
In this video, I discussed about Getting File Names Dynamically from Source folder in Azure Data FactoryLink for Azure Functions Play ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
Why not just create a storage script that changes the directory dynamically ? Example of code i use to achieve this .
Dynamically changing destination folder name is done by using formidable and fs
var formidable = require(‘formidable’); var fs = require(‘fs’);