0

When using the below code to try to open File Explorer to a folder path I get the errors SEC7134: Resource 'file://...' not allowed to load, and SCRIPT70: Permission denied.

However if I copy the exact path returned in the error and past it into the url it opens a new file explorer window without any issues. This was working at one time for me as expected, I'm wondering if there have been security changes or things that need to be updated on my side to open these files in File Explorer again.

Thanks,

function openFile(path) { // Internet Explorer 6-11 var isIE = /*@cc_on!@*/false || !!document.documentMode; // Edge 20+ var isEdge = !isIE && !!window.StyleMedia; if (isIE || isEdge) { window.location.href = path; return false; } } 

1 Answer 1

0

Yes, we could use the browser as file explorer to retrieve the files in our local environment. But, reading local files from the browser (using JavaScript) is not allowed. This will prevent websites reading files and stealing your information.

If you want to display the local file using JavaScript, you could use the upload control select the local file, then, read the file and display it.

Sign up to request clarification or add additional context in comments.

2 Comments

I don't want to open a file, but a folder. Is this the same for opening folders? I've been able to use this code to open a folder location in the past.
Yes, I think it is same for the folders. you could also check this thread.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.