0

I have an input file all extensions are allowed, but usually they will be uploaded pdf.

<input id="myFile" name="myFile" type="file"></input>

 var myDocument = $('#myFile').val();
 myDocument = 'file:///' + myDocument;
 var popup = window.open(documento, 
    'Documentos', 
    'titlebar=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,width=800,height=600,top=0,left=0,type=fullWindow,fullscreen=no,scrollbars=yes');
});

"document" has the correct local path, but I have an error in the console:

SCRIPT5: Access is denied.

If I copy & paste the value of document, it opens the file.

Is it possible to preview the file before upload it?

cucuru
  • 3,456
  • 8
  • 40
  • 74
  • Possible duplicate of http://stackoverflow.com/questions/3582671/how-to-open-a-local-disk-file-with-javascript – stephen.vakil Feb 09 '17 at 16:46
  • Possible duplicate of [Preventing "SCRIPT5: Access is denied" error in IE](http://stackoverflow.com/questions/17370482/preventing-script5-access-is-denied-error-in-ie) – LordNeo Feb 09 '17 at 16:47
  • check this: http://stackoverflow.com/questions/17370482/preventing-script5-access-is-denied-error-in-ie it's some kind of weird CORS error. It says that using a newer jquery (>1.10.2) it's fixed. – LordNeo Feb 09 '17 at 16:48
  • I'm using jquery 1.12.4, it should work, shouldnt it? – cucuru Feb 09 '17 at 17:26

0 Answers0