Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 19th, 2006, 12:59 PM
Registered User
Join Date: Jan 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default opening direct file names client side

I imagine this is a security risk and is not possible but it can't hurt to ask.
I have 2 files located in C:\TestIn IE from the address bar I can type. File:///C:\Test\NewDoc.xls
and that file opens in Excel. Likewise I can type File:///C:\Test\NewDoc.txt and the other file will open in notepad. Is there a way that I can create an asp.net webpage with an <h ref> tag or meta tag redirect or even server side redirect or javascript document.location.href = "..." so the same thing will happen.

we have a shared directory with the same mapping letter, so if I save a link to a file at H:\test\test.txt then another person at another computer will be able to open that same file from our website link. Note: I'm storing these links in a database.
Old August 14th, 2006, 01:44 PM
Registered User
Join Date: Jan 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Does no one out there have an answer to this?
Old August 14th, 2006, 01:49 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

can you just use an html link object???


Old August 14th, 2006, 03:22 PM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

Yes, this is quite possible. I would suggest setting up a virtual directory of some sort through IIS then in your href you could do something like this:

a href="http://mysite/virtualdirectory/somefile.xls" target = "new"

That will work to download the file, the user will just have to select open instead of Save if they wish to view it right then.


"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
opening client side folder browser in c# sauravnimesh .NET Framework 2.0 4 November 21st, 2008 07:20 AM
how to save a file on client side gauravawas ASP.NET 2.0 Professional 0 April 23rd, 2008 07:55 AM
file reading on client side vishalres Classic ASP Professional 0 April 9th, 2007 02:15 AM
File size on client side vincentvdm Classic ASP Basics 0 August 25th, 2003 02:19 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.