-
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
Res to rename file #620
Comments
I think you can access the Response on |
Yes, it's good ! Thank you very much ! So, I have another question. If upload is success but after i have a problem with insert name in database, its possible to delete the file upload with multer ? Of i must do that with FS in node ? :) Sorry, it's a little bit off topic but i can't find this option in documentation and i think it's necessary. |
You need to do that manually with FS :) |
Thanks :) I close it. |
Hello,
I have a question about Multer. Is it possible to retrieve the Response object from Express in the file rename function?
I use this route here:
app.post("/companies/upload", ensureAuthenticated, upload, CompanyController.upload);
I have a first Middleware (ensureAuthenticated) that decrypts the token, and returns the user ID in the object
res.locals.token
.So, i want to rename the file with the id of the user or his company and so, to make a request before renaming it.
Like this for example:
Can i do that (pass the res object) ? Or is it possible to rename the file AFTER in the next middleware ?
Or the only way is to pass company.id from front in file object ?
Thanks. 😄
The text was updated successfully, but these errors were encountered: