D
D
Deodatuss2014-10-20 23:34:14
JavaScript
Deodatuss, 2014-10-20 23:34:14

Is there some elegant way to display the uploaded image in input type=file without server requests and third party plugins?

I read about FileReader, but from the examples I somehow did not catch how to work with it. Does anyone have any ready made solutions? Thanks a lot.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Popov, 2014-10-20
@Deodatuss

More elegant than ever

D
darkdaskin, 2014-10-22
@darkdaskin

If the image does not need to be processed, URL.createObjectURL is simpler than FileReader ( example ).
Plus - less memory consumption.
The downside is slightly less browser support.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question