-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Multer: how to name files after req.body parameters #134
Comments
the documentation also states that accessing req.body is not allowed in this function, so any idea of how this would be achieved? |
Using the code in #131 you should be able to read Actually it probably should work already, as long as you don't use any brackets in the field names. |
This is how it will always be since we can't change the order in which the browsers sends the data. If you cannot place the file-input later in the DOM, you could use javascript on the client side to construct your own FormData with the files added last. |
I'm trying to upload a file with a form such as below
and I would like to rename to file to the name in the id input (ABCDEFG). As I can't access the req.body through the rename: function(fieldname, filename), I was wondering how I would achieve this?
The text was updated successfully, but these errors were encountered: