I am just giving livewire a try for my next project but I am stuggling a bit with finding a solution for this.
I have page for uploading files.. Any file, so no image preview is needed. But I would like to show the file, and allow the user to delete it if they regret adding it. So multi-file upload with drag-and-drop or click to select.
I know I can use something like dropzone to do this, but the problem is that I don't want the files to be uploaded on drop. Instead I was hoping to somehow append the files to livewires upload request when the form is submitted.
Currently I am just using alpine to catch dropped files, and that works file. But I dont know what to do with them afterwards :)
handleFileDrop(e) {
if (e.dataTransfer.files.length > 0) {
const files = e.dataTransfer.files;
this.files = this.files.concat(...files)
}
},
files: []