Either I suck at this, or Volt handles file uploads very poorly. Again, it might be a me problem but I'm finding a ton of bugs as I'm trying to solve this issue. Here's a few :
-
422 Unprocessable Content error (still nothing validation-wise, the error is on the console logs) : the file input has
accept="image/*"attribute, and I'm selecting an image, mimetype exactly shows :image/jpegAnd I have no idea what is unprocessable about this file. -
The uploadedImage failed to upload.validation error : While the only unvalidated thing about the image is its size. Validation rules are: "required|image|max:1024" The image size is 2.1MB, mimetype stillimage/png, Logically, I should be getting filesize error, not this ambiguous "failed to upload" thing.
I give up. I don't think Volt is there yet. I'm going to rewrite this component using livewire only.
Searching "livewire volt file upload" on google doesn't return any results anyway. Maybe I'm not aware that doing such thing with Volt is not possible. Because even Volt documentation doesn't show anything about file uploads. There is one image upload example in the docs that I can find. And that is for a function-based component, I don't know if that changes anything because I'm using class-based.