javascript - Ie 8.0 Access Denied When Trying To Open Local Files -


this script works in ie 6 not in ie 8.0 users "access denied error". settings refer users enable local file access script work?

<script language="javascript"> function viewfile(selecteditem) {  (i=0; i<selecteditem.options.length; i++) {   if ((selecteditem.options[i] != null) && (selecteditem.options[i].selected == true)) {    window.open("file://"+selecteditem.options[i].text);   }  } } </script> 

users can select multiple files local drive. list stored in text box , clicks on 1 selected file list.

example:

selecteditem.options[i].text = c:\documents , settings\all users\documents\my pictures\sample pictures\sunset.jpg 

you're not going able "out of box" anymore ie8's security model stricter ie6.

your options limited, can include:

  1. developing flash component access user's local drive.

  2. implement site hta (html application) gives promoted access user's file system.

  3. have visitors customize ie security settings adding site list of trusted domains , give trusted domains access file:/// protocol (i'm not sure security setting applies particular feature, or if 1 available.)

  4. develop pluggin or bho object (similar flash component, written in c++ or c#)

  5. create ie context menu - http://msdn.microsoft.com/en-us/library/bb735853(v=vs.85).aspx have elevated privileges.

as side note proper file schemes c:\ paths should this:

file:///c:/documents%20and%20settings/file.jpg

notice 3 / after file:, uri-escaped spaces, , \ switched /


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -