Before I start - I am using Laravel5.
I got the upload image function working, everything is great thanks to you guys, but I started wondering. Is there a proper way of displaying the image before I upload it? I want admin to be able to see the image right after he chooses it, but before the upload, so he will upload the correct image for sure. Just clicking "Browse" -> choosing the image file -> clicks "Open" and then it appears - the preview of the selected image.
I am using a simple laravel5 upload form:
<form method="POST" action="{!! URL::to('adminPanel/addImg/done/'.$projectId) !!}" accept-charset="UTF-8" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input name="image" type="file" />
<br><br>
<input type="submit" value="Mainīt"/><br>
{{Session::get('error')}}
</form>
SOLVED the solution can be found here right in the first answer: Preview an image before it is uploaded works like a charm, all you need to do is just optimize the code to your situation, there's also a sample of how it works