mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-22 07:50:36 +01:00
feat(FileUpload): new component
Co-Authored-By: Vachmara <55046446+vachmara@users.noreply.github.com>
This commit is contained in:
12
playground/server/api/blob.put.ts
Normal file
12
playground/server/api/blob.put.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export default eventHandler(async (event) => {
|
||||
return hubBlob().handleUpload(event, {
|
||||
formKey: 'files', // read file or files form the `formKey` field of request body (body should be a `FormData` object)
|
||||
multiple: true, // when `true`, the `formKey` field will be an array of `Blob` objects
|
||||
ensure: {
|
||||
types: ['image/jpeg', 'image/png'] // allowed types of the file
|
||||
},
|
||||
put: {
|
||||
addRandomSuffix: true
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user