Show files in new window
问题 I want to display or show my file in a new tab, but before that, I had to upload my file first I've tried to use FileReader() and I can't load the image function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#blah').attr('src', e.target.result); window.open(e.target.result); } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function() { readURL(this); }); <script src="https://cdnjs.cloudflare.com/ajax/libs