I've got a form where users are able to update an avatar for their profile. . I'm wondering what the process/sequence of events is for uploading an image after a user submits the form (I don't want the upload to happen when the image is changed in the form). I'm able to capture the Data URI for the image source in the controller without a problem. But I'm wondering, how to convert that into an image that can be uploaded and the url stored in the database?
Post request as normal, where you process the request I use request->file() as in the docs. Laravel has helpers to move the file and you need to specify the path to move it to. I save that path and file name as the url to the image in the database too.
Files 101 video here Explains it along with the creating flyer series. Though the series uses Dropbox, the code is the same to process the image.
It was sort of a combination of both answers. @jekinney your answered helped with the manual upload I was doing and @dharmendrajadon your answered helped with uploading a file from drag and drop. Thanks!