Currently I am uploading images through a blade view and a POST-request, which allows me to validate the image and redirect/output errors, if they exist. But there is no real-time feeling, as it either uploads a file or doesn’t.
But it works.
I wanted to hear your thoughts on uploading images. Are you preferring uploads through vue components? Here, one could implement a loading logic, but displaying errors would be more difficult, right?
How are you handling image-uploads? (in production, or locally)
Using axios along with Vue gives you access to onUploadProgress event which allows you to display the progress for larger file uploads. The FormData api is simple enough for appending the image to the POST request, and errors are relatively trivial to handle in the rejected Promise
@tykus - Thank you. Currently if I place the image besides the upload input, logically it will be updated to the new one after the redirect. In vue, would you also include the <img :src=""> in the component, and would it then change to the new image after the upload was finished?
And generally, is there any problem with uploading simply through the blade view - and redirecting after the upload?
There is an old Laracasts series where Jeffrey handles an avatar upload which displays the new image as you describe; the code is here, and the episode here. It is old, but mostly how you would approach the issue today.
I have been using DropZone and Vue to upload files to the various cloud providers.
In my opinion, there are tons of front end JavaScript options out there to give you a seamless look or feel to your front end uploading processes (and I am not a front-end/designer type at all).