@multipart/form-data
Version:
Multipart/Form-Data And File Upload Middleware For Koa Written In ES6 And Optimised With JavaScript Compiler.
14 lines (13 loc) • 833 B
text/xml
<types namespace="_multipart">
<import name="IncomingMessage" from="http" />
<record name="FormDataDiskStorageOptions">
<prop type="string|function(http.IncomingMessage, _multipart.FormDataFile): !Promise<string>" name="destination" opt>
Used to determine within which folder the uploaded files should be stored. If given as a string, the location will be ensured prior at the start. Default is `tmpdir()`.
</prop>
<fn async return="string" name="filename" opt>
<arg name="req" type="!http.IncomingMessage">The request.</arg>
<arg name="file" type="!_multipart.FormDataFile">The file.</arg>
Used to determine what the file should be named inside the folder. If no filename is given, each file will be given a random name that doesn't include any file extension.
</fn>
</record>
</types>