multer icon indicating copy to clipboard operation
multer copied to clipboard

Fix file exists but file name does not exist

Open Relsoul opened this issue 1 year ago • 1 comments

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

Relsoul avatar Jun 12 '23 09:06 Relsoul

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.

Relsoul avatar Jan 22 '24 03:01 Relsoul