file open with web app

P

Paul

Hi I am able to upload files to a server with a .net web application. The
problem is I am providing a hyperlink so the user can open the file after it
is placed on the server. For the URL I am using the absolute path to the
file and setting this dynamically after the file is uploaded. For the
hyperlink I have the target set to _blank. When clicking on the hyperlink
nothing happens, wondering if I need to use a file open control and if there
is one with .net 2005?
thanks!
 
P

Paul

I located the open file dialog in the toolbox but it is not enabled.
Wondering if this control only works for windows apps!--
Paul G
Software engineer.
 
P

Paul

thanks for the response, that seems to be the problem.
string abstpath = Server.MapPath(newpath + FileUpload1.FileName);
"C:\\folder1\\folder2\\filename"
Do you know if there is an easy way to get the path in the http format?
Guess it is possible to convert the path with the C:\\ to the correct one
with string.replace.


--
Paul G
Software engineer.


Patrice said:
Absolute path that is ? Use "view source" to check exactlly whihc lcoation
is used in your HTML markup. Make sure it looks like
"http://mysite/mydir/myfile.doc" not "c:\serverdir\myfile.doc" that doesn"t
make sense client side).

For the same reason using an open dialog wouldn't make sense The client
can't see directly the server drive.
 
P

Paul

got it working, just used ~/folder/filename.
--
Paul G
Software engineer.


Patrice said:
Absolute path that is ? Use "view source" to check exactlly whihc lcoation
is used in your HTML markup. Make sure it looks like
"http://mysite/mydir/myfile.doc" not "c:\serverdir\myfile.doc" that doesn"t
make sense client side).

For the same reason using an open dialog wouldn't make sense The client
can't see directly the server drive.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top