This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I have a JSP page where I am providing a hyperlink to a file on the C: drive as follows
<a href="C:\ReqImport\data.txt" target=_blank >Try this </a>
Nothing happens when I click this hyperlink.
When I scroll over the hyperlink I see the correct path "file:///C:/ReqImport/data.txt" in the status bar and when paste this path in my address bar, it does open up the file.
Any ideas why this file hyperlink does not work on this JSP page.
The webapp is processing a data file on the users hard drive and then writing to an error file on the drive. So the hyperlink is for the user to open that error file.
The user should have to explicitly upload the file to be processed. Think of the horrible things that a nefarious site could do if it were allowed to read and write from/to your hard drive.
If you want to bypass browser security, you might want to look into signed applets.
Yuma Shankar
Greenhorn
Joined: Jun 07, 2005
Posts: 24
posted
0
Thanks Ben!
Charles Lyons
Author
Ranch Hand
Joined: Mar 27, 2003
Posts: 836
posted
0
In theory the link "file:///C:/ReqImport/data.txt" should cause the browser to show the specified file (or prompt for download, depending on the file type).
Since this was a security concern, Internet Explorer 6 with Service Pack 1 now blocks the file protocol from being used by Internet sites. It will still work locally within Windows.
Of course, accessing client-local resources should never be a design 'feature' of your site! [ December 30, 2005: Message edited by: Charles Lyons ]
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: hyperlink to file on C: drive does not work