node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

fileWriteStreamHandler can be more info #882

Closed handbremse closed 1 year ago

handbremse commented 1 year ago

Cool feature to build own writeStreams for fileWriteStreamHandler: . But where can I find the data key in the argument. lastModificationDate is null? originalFilename: "blob" => due to FormData.append() => OK can be fixed by FormData.set("key", blob, "filename")

VolatileFile {
  _events: [Object: null prototype] { error: [Function (anonymous)] },
  _eventsCount: 1,
  _maxListeners: undefined,
  lastModifiedDate: null,
  filepath: '/var/folders/zh/z0087yk528q8btg8n3n1dk980000gn/T/2d5fab6683deecb2414d13900',
  newFilename: '2d5fab6683deecb2414d13900',
  originalFilename: 'blob',
  mimetype: 'image/jpeg',
  hashAlgorithm: false,
  createFileWriteStream: [Function: fileWriteStreamHandler],
  size: 0,
  _writeStream: null,
  hash: null,
  [Symbol(kCapture)]: false
}
GrosSacASac commented 1 year ago

This is something that browsers usually send when uploading a file.

What library do you use to polyfill FormData ?

handbremse commented 1 year ago

.. it is a javascript browser request .. I'm use https://developer.mozilla.org/en-US/docs/Web/API/FormData

GrosSacASac commented 1 year ago

Can you describe what you want ?

In case you want to be able to customize lastModificationDate you should contact the whatwg organization because they are responsible for this API I believe