diff --git a/cista-front/src/components/UploadButton.vue b/cista-front/src/components/UploadButton.vue index d3caefe..a125ea0 100644 --- a/cista-front/src/components/UploadButton.vue +++ b/cista-front/src/components/UploadButton.vue @@ -55,11 +55,16 @@ async function sendChunk(file: File, start: number, end: number) { } } -async function uploadFileChangeHandler(event: Event) { +async function uploadHandler(event: Event) { const target = event.target as HTMLInputElement const chunkSize = 1 << 20 - if (target && target.files && target.files.length > 0) { - const file = target.files[0] + if (!target?.files?.length) { + documentStore.error = 'No files selected' + return + } + for (const idx in target.files) { + const file = target.files[idx] + console.log('Uploading', file) const numChunks = Math.ceil(file.size / chunkSize) const document = documentStore.pushUploadingDocuments(file.name) open('bottomRight') @@ -78,14 +83,14 @@ async function uploadFileChangeHandler(event: Event) {