T
TLM
I am trying to build a web application that will contain
links to files on a users local computer. I am assuming
that the files will be in a known location and can display
in a browser window.
I have my ASP.NET application building links along the
lines of
file://c:/<path to file>
When I use the link in IE 6.0's address bar, I am able to
see the file as expected. If I use the link on an ordinary
HTML page, I am also able to use the link and receive the
file as expected.
I can refer to pages via file://localhost if (and only if)
they are located in my inetpub/wwwroot directory of a
computer with IIS or PWS (but since I cannot assume that
my users have that, it does not really help). I have
found that once I have called a plain HTML file in this
way, if it has links in the file://c:/<file path> format,
they work normally.
However, when I use the link from within an ASPX page, the
page does not change. I have seen occasionally (but not
always) a bit of a JavaScript message in the status bar
that appears to be some validation firing that simply
redirects me back where I started -- effectively doing
nothing.
So: I know that the failure to display the file is not a
browser issue per se since I can use the File: url in both
the address bar and a plain HTML page. I have a suspicion
that there is some default validation code that prevents
this sort of URL from firing from VS 2003-built ASPX.
I am even able to find the path in the output HTML file
and past that into the IE address bar to navigate to the
file -- I just cannot navigate to it from within the ASPX
page.
I have not found any solid references to this sort of
thing on the net or in my hardcopy books.
I have tried setting validateRequests = "false" without
effect. Same with commenting out references to
vs_defaultClientScript.
I have also tried this from other computers (Win2k, XP
Home, XP Pro), and I have tried using invalid file: URLs
as well (these don't even return a 404 error). Attepting
to 'open in new window' has variously returned the bit of
JavaScript in the address bar and done nothing.
Unfortunately, one or another of the things I have tried
is now preventing the JavaScript from appearing, but as I
recal, it was calling a page_validate method of some sort.
When I put the path as the SRC of an iFrame on an ASPX
file, the frame shows nothing: viewing the source of the
frame shows only a pair of empty <HTML></HTML> tags.
Links using the HTTP:// path work normally; those using
file:// do not. The net effect is that 'nothing' apparent
to the user seems to be happening.
This looks like a security 'feature' albiet an
inconvenient one for me.
Does anyone have any suggestions on how to reference files
on a local computer drive from within an ASPX file?
links to files on a users local computer. I am assuming
that the files will be in a known location and can display
in a browser window.
I have my ASP.NET application building links along the
lines of
file://c:/<path to file>
When I use the link in IE 6.0's address bar, I am able to
see the file as expected. If I use the link on an ordinary
HTML page, I am also able to use the link and receive the
file as expected.
I can refer to pages via file://localhost if (and only if)
they are located in my inetpub/wwwroot directory of a
computer with IIS or PWS (but since I cannot assume that
my users have that, it does not really help). I have
found that once I have called a plain HTML file in this
way, if it has links in the file://c:/<file path> format,
they work normally.
However, when I use the link from within an ASPX page, the
page does not change. I have seen occasionally (but not
always) a bit of a JavaScript message in the status bar
that appears to be some validation firing that simply
redirects me back where I started -- effectively doing
nothing.
So: I know that the failure to display the file is not a
browser issue per se since I can use the File: url in both
the address bar and a plain HTML page. I have a suspicion
that there is some default validation code that prevents
this sort of URL from firing from VS 2003-built ASPX.
I am even able to find the path in the output HTML file
and past that into the IE address bar to navigate to the
file -- I just cannot navigate to it from within the ASPX
page.
I have not found any solid references to this sort of
thing on the net or in my hardcopy books.
I have tried setting validateRequests = "false" without
effect. Same with commenting out references to
vs_defaultClientScript.
I have also tried this from other computers (Win2k, XP
Home, XP Pro), and I have tried using invalid file: URLs
as well (these don't even return a 404 error). Attepting
to 'open in new window' has variously returned the bit of
JavaScript in the address bar and done nothing.
Unfortunately, one or another of the things I have tried
is now preventing the JavaScript from appearing, but as I
recal, it was calling a page_validate method of some sort.
When I put the path as the SRC of an iFrame on an ASPX
file, the frame shows nothing: viewing the source of the
frame shows only a pair of empty <HTML></HTML> tags.
Links using the HTTP:// path work normally; those using
file:// do not. The net effect is that 'nothing' apparent
to the user seems to be happening.
This looks like a security 'feature' albiet an
inconvenient one for me.
Does anyone have any suggestions on how to reference files
on a local computer drive from within an ASPX file?