feat(FileUpload): new component

Co-Authored-By: Vachmara <55046446+vachmara@users.noreply.github.com>
This commit is contained in:
Benjamin Canac
2025-07-16 10:22:06 +02:00
parent 10450c537d
commit 01c8f3bf5e
10 changed files with 275 additions and 9 deletions

View 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
}
})
})