-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to use dynamic upload path? #16
Comments
There is a preSave hook available. Put a |
Okay, thank you! :) I thought the solution was going to be complex, but seems like preSave can handle my needs |
You'll have to dynamically update the path that the multipart middleware is using to store the files. The actual file upload is handled by the multipart middleware. |
Ok, looks like actual file upload happens before preSave |
Yes, you are correct, so it seems that my idea was to augment only the record storing, not the file storing. |
Hello!
I would like to have dynamic file upload path, because if i will upload all the files into one directory, it will lead to problems, due to large amount of files.
How can i easily (or not) make express-admin to get upload path as a function result?
The example is - songs library, including mp3/wav/etc/etc for my radio
I would like to store all the files i upload in the directories like {artist_id}/{album_id}/{track_name}.{ext}
And when i would edit any existing entry in my database, i'd love to make express-admin to seek file in that dynamic directory path
Thanks foward :-)
I am relatively new to GitHub, but experienced programmer
The text was updated successfully, but these errors were encountered: