ARGH! can't open a local file

M

Michael Peters

I want to open local files from my page (for a local intranet application),
such as Word DOC files, Access MDB databases, etc. But it doesn't work!
Nothing happens when I click. Not even HTML files are opened. This must be a
stupid mistake but I can't see it. Help!

Here's an example link that doesn't work:

<a href="file://F:\Temp\test.htm" target="_blank">external file</a>

I tried all kinds of variations, such as

<a href="file:///F:\Temp\test.htm" target="_blank">external file</a>

none works. I use MSIE6.

-Michael
 
J

Jim Higson

Michael said:
I want to open local files from my page (for a local intranet
application), such as Word DOC files, Access MDB databases, etc. But it
doesn't work! Nothing happens when I click. Not even HTML files are
opened. This must be a stupid mistake but I can't see it. Help!

might this be a security thing...?
Here's an example link that doesn't work:

<a href="file://F:\Temp\test.htm" target="_blank">external file</a>

I tried all kinds of variations, such as

<a href="file:///F:\Temp\test.htm" target="_blank">external file</a>

none works. I use MSIE6.

...ah, maybe not :)
Seriously, it does seem a security issue if remote pages were allowed to
access the local filesystem.

When you say 'local files' do mean local to the server or to the browser?
Can't you put the files on the intranet server and use relative URLs?
 
M

Michael Peters

Seriously, it does seem a security issue if remote pages were allowed to
access the local filesystem.

they're not remote. They are on my machine, the same machine that keeps the
files that I want to open. I can open the files from the browser by using
"file - open - browse" from the browser menu. When I go to the properties of
the opened page, the address of the page is

file://F:\Temp\test.htm

which is identical to the href of the link. When I click that link, nothing
happens.

When you say 'local files' do mean local to the server or to the browser?

to the browser, they are on my own machine.

Can't you put the files on the intranet server and use relative URLs?

Actually what I ultimately want to do is, open a certain Microsoft Access
database which is somewhere in the local network, and open it with
arguments. Or I want to open a certain Word document that is somewhere in
the local network, or on the local machine. Instead of using COM or
ActiveXObjects, I wanted to simply use links - and for the life of it I
can't see why this doesn't work. Yes I could put them on the server and use
relative URLs, but then they'd have to be located somewhere in the webserver
directory, which they aren't.


-Michael
 
M

Michael Peters

Here's an example link that doesn't work:

ok, I just found out that this _used_ to work but that modern browsers don't
do this any longer, due to security reasons. Ok.


-Michael
 
M

Mark Parnell

<a href="file:///F:\Temp\test.htm" target="_blank">external file</a>

This one is more correct than the other one, but URLs should have
forward slashes, not backslashes. E.g.
<a href="file:///F:/Temp/test.htm" target="_blank">external file</a>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top