Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am currently developing an Intranet web application. I want the application to access local files in the user's computer or the domain files (hence Intranet).

I managed to give local file access (href for <img> and <a> ) in Firefox in user.js, the problem is with chrome. How to do it ??

share|improve this question
    
Can you be more specific with local access? Do you want to link to a document, do you want to include images? –  LPChip Apr 8 at 13:20
    
both. Generally, to be able to use 'file:///' protocol to link to any file in the domain. –  Ayman Apr 8 at 13:22

2 Answers 2

Share the directory you want to use and then access it using:

<a href="http://pcname/share/path/file.ext">Description of file</a>

Browsers tend to see "file://" as a security risk and block it. Besides, by using this method, people in your network will be able to access the file.

share|improve this answer

Your question isn't clear - not sure if you're trying to access resource files (such as .css files) or documents like Word processing files or similar. I'm going to assume documents and directories.

The issue is, you can't open directories via Windows Explorer, it's as simple as that as it's a security risk. However, you can open directories in the browser.

This works for Chrome, Firefox and IE

<a href="file://C:\Users\me\Documents\">Open directory</a>

<a href="file://C:\Users\me\Documents\1_011014_135535239_.csv">Open file</a>

If you're still blocked, then you need to give permission by the folder to the relevant groups (or by everyone if safe to do so).

share|improve this answer
    
The issue is, you can't open directories via Explorer, it's as simple as that as it's a security risk. However, you can open directories in the browser. What did you mean by this ?? –  Ayman Apr 8 at 14:48
    
Sorry, that wasn't clear - From HTML you can't open Windows Explorer. I updated my question –  Dave Apr 8 at 14:49
    
Another thing that I mentioned, I already did it in Firefox, you can check this link –  Ayman Apr 8 at 14:49
    
I think I've now understood the question - you are talking about updating the browsers to allow this? What happens when a new browser comes out? What happens if Firefox decide to retract this functionality? –  Dave Apr 8 at 14:51
    
Currently I am developing for Firefox and Chrome (A company's Intranet). The only thing I need from the browser is to allow the file:/// protocol to access local documents for downloading/reading/... –  Ayman Apr 8 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.