We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am uploading file from frontend to get URL but when I upload the file with multer, it automatically changes the file type on the backend.
I used word changes here because the file type shows correct on the frontend. For example: the file I am uploading is of type
{ path: "2023-12-14 13-19-55.mkv" type: "video/x-matroska" lastModified: 1702539348430 lastModifiedDate: Thu Dec 14 2023 13:20:48 GMT+0545 (Nepal Time) {} name: "2023-12-14 13-19-55.mkv" size: 17555107 }
But on the backend it shows:
{ fieldname: 'imageData', originalname: '2023-12-14 13-19-55.mkv', encoding: '7bit', mimetype: 'application/octet-stream', destination: 'uploads/', filename: '1712392840374-2023-12-14 13-19-55.mkv', path: 'uploads\\1712392840374-2023-12-14 13-19-55.mkv', size: 17555107 }
Why does it change the file type?
The text was updated successfully, but these errors were encountered:
@nirajchaurasiya the first place I would start looking is this line of code in BusBoy, which is what multer uses behind the scenes.
multer
I'm guessing the browser doesn't know what file type .mkv is and is setting the content-type to application/octet-stream.
.mkv
content-type
application/octet-stream
Sorry, something went wrong.
No branches or pull requests
I am uploading file from frontend to get URL but when I upload the file with multer, it automatically
changes the file type on the backend.
I used word changes here because the file type shows correct on the frontend.
For example:
the file I am uploading is of type
But on the backend it shows:
Why does it change the file type?
The text was updated successfully, but these errors were encountered: