multer
multer copied to clipboard
Fix file exists but file name does not exist
https://www.rfc-editor.org/rfc/rfc1867 file name is an optional field.
eg.
----------------------------052948472259119770453321
Content-Disposition: form-data; name="filepond"
Content-Type: application/octet-stream
yep, Here is a simple demo: https://github.com/Relsoul/upload-demo
In the browser environment, formData.append(name, value, filename); docs: https://developer.mozilla.org/en-US/docs/Web/API/FormData/append
The filename is optional, but the browser will automatically add a filename for Blob/File type objects. However, in other environments, the filename may not be automatically added. When I use a buffer for direct upload, I might ignore the filename.
In Node Express, this is reflected in that if the filename does not exist, it skips the destination function and filename function.