problem
- upload image via
<input> - inject that file into
<img src=""> -
srcurl is blob url - when i try to copy this
src: blobUrlinto another<img src="">tag, it throwsfile not found errorbc the image is not saved in server.
solution
- when upload the image, use
FileReader()API - convert the uploading-image into base64 string with
readAsDataURL() - inject that base64string into
<img src=""> - now you can take that
srcto any other<img src="">tags
Top comments (0)