I depends on what exactly you want to do. Do you want to send the photo to your server for image processing first? Are you using a javascript framework?
Dec 23, 2016
3
Level 1
photo preview on uploading
Hello. This is my first time posting here, so I'm sorry if I didn't provided enought information. I have a file uploader called main_photo and a div id->main_image. What I want to get is basically when he choose the picture, I need to grab that temp pic and update the div tag with a new with that picture. Basically, as soon as he choose the file, I need to grab that temp file and display it in an img tag, is there any way to do it? Im using intervention for image uploading (laravel as framework). Thanks
Level 8
You'll want to use the FileReader class and readDataAsURL() method:
https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
2 likes
Please or to participate in this conversation.