Allow user to specify temporary upload directory#9
Allow user to specify temporary upload directory#9joaogodinho wants to merge 2 commits intodekyfin:masterfrom
Conversation
Initializes multer inside the module to allow a user to specify the destination directory.
There was a problem hiding this comment.
Thanks for your contribution to make RFM-node better. I would like you to make a couple of minor changes for forward compatibility.
-
Instead of passing the
tempdir as the third parameter of the middleware, let it be an object like this:{tempDir: /path/to/temp}. This way, we can add other configurations in the future. -
The default tempDir should be changed from
public/to.tmpso it doesn't conflict with existing files -
I would appreciate it if you could add a section to the Readme that talks about the new options being introduced
Looking forward to your further contribution. Thanks
|
Hi, Maybe use the already existing config file/path for it then? e.g. if there is a |
|
Exactly. The existing config is for RichFileManager and not implementation configuration. I would like us to use the third parameter for extra config |
|
Hello! Good timing, I'm running into the same issue. I'm wondering why not use a package like https://www.npmjs.com/package/mv instead (or in addition). In my case, it would be cleaner to not have the temp folder in the target directory (which is mounted as a shared docker volume and it meant to contain only the public files). |
I added a parameter to the initialization of the module to allow a user to specify where to initially save uploaded files (multer
destparam).I made this as a solution to the
fs.rename. If the destination path is mounted in a different device as the multer destination folder, aEXDEVis raised.