Access a file from a form using an input file element


I want to access a file (for example, an image) using JavaScript with this form:

<form id="form" enctype="multipart/form-data"> <input type="file" size="40" value="" id="upload" name="upload"/> <input type="submit" id="submit" name="submit"/> </form> 

Is there any way to do this? I am trying to upload the image specified by the client to the hatml5 cavas element without sending it back to the server.

+4
source share

Source: https://habr.com/ru/post/1340866/


All Articles