Active Server Pages Programming (ASP)/hyperlink to open a disk file

Advertisement


Question
QUESTION: In html page I can open a disk file with this code:
<a href="file:///C:/AMR2008CM/App_Data/fastopen.xls" >
In VS2005 within ASP page the followeing code does not open
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="htmllink1.aspx.vb" Inherits="htmllink1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>Untitled Page</title>
</head>
<body>
   <form id="form1" runat="server">
<div>
this
    </div>
   </form>
</body>
</html>
Ashley, Can you help me where I am making a mistake?

ANSWER: Hi,

Can you not reference it as a link ie http://nameofsite/nameofile.xls
Thanks

---------- FOLLOW-UP ----------

QUESTION: Thanks Ashley for immediate response. My module wants to access files on local network without storing the same on IIS server as these files are constantly being updated and large in numbers as well as size. Hence copying and updating them on server is not practical.
If I type that command in html - it gives me no problem at all for example this statement in html  opens up from any pc on network

<html>
<body>
<a href="\\thurman\Y Drive\Reading & Billing\Bills\Sky Tower\2007\BUDGET TEMP.xls" >
Open file
</body>
</html>
Please let me know how to solve this


ANSWER: Try this:-
<html>
<head>
  <title>Untitled Page</title>
</head>
<body>


this
  

</body>
</html>

save as .asp

does that work?

---------- FOLLOW-UP ----------

QUESTION: yes - but results are no different - with my pc it works fine becuase iis is on my pc but on other pcs on network browser page opens there but Excel file opens on my PC

I wonder if this has to anything with DCOMCNFG utility to be run on server as well as all the client machines.


Answer
Hi,

where the files are kept you will have to set it so they are shared.

If you reference it as file file:///C:/AMR2008CM/App_Data/fastopen.xls it will check the users c drive.

If you make App_Data a sharefolder with read permissions to everyone it will work.

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Ashley Brazier

Expertise

Main focus is ASP, SQL Server 2000 & 2005

Experience

Over 6 years experience.

Education/Credentials
BCs Honours Software Design and Networks

©2012 About.com, a part of The New York Times Company. All rights reserved.