473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

file open with web app

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!
--
Paul G
Software engineer.
Jun 27 '08 #1
5 1423
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.
"Paul" wrote:
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!
--
Paul G
Software engineer.
Jun 27 '08 #2
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.

--
Patrice

"Paul" <Pa**@discussions.microsoft.coma écrit dans le message de groupe de
discussion : 9B**********************************@microsoft.com...
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!
--
Paul G
Software engineer.

Jun 27 '08 #3
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" wrote:
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.

--
Patrice

"Paul" <Pa**@discussions.microsoft.coma écrit dans le message de groupe de
discussion : 9B**********************************@microsoft.com...
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!
--
Paul G
Software engineer.


Jun 27 '08 #4
got it working, just used ~/folder/filename.
--
Paul G
Software engineer.
"Patrice" wrote:
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.

--
Patrice

"Paul" <Pa**@discussions.microsoft.coma écrit dans le message de groupe de
discussion : 9B**********************************@microsoft.com...
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!
--
Paul G
Software engineer.


Jun 27 '08 #5
Yes, this is likely the Windows Forms dialog.

You have nothing out of the box for this as accessing client side files from
a server would be a security issue so HTML has only something that allows
the *user* to select a file (i.e. setting the file path programmatically
wont work). You can do so but you have then to install something client side
the user will have to accept...

Also as you have seen Server.MapPath is to map the location of a file on
your web site to a physical location on your server i.e. this is used when
files are handled server side not client side...

Here you don"t have anything to use . You just provide the approrpiate link
and the browser will open the file...

--
Patrice
"Paul" <Pa**@discussions.microsoft.coma écrit dans le message de groupe de
discussion : B4**********************************@microsoft.com...
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.
"Paul" wrote:
>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!
--
Paul G
Software engineer.

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
16
by: Chuck Amadi | last post by:
Sorry to bovver you again (again) here's script. I still can't see why the get_payload() doesn't produce the plain text message body of an emails in the testwwws users mailbox. As you can see I...
22
by: Ling Lee | last post by:
Hi all. I'm trying to write a program that: 1) Ask me what file I want to count number of lines in, and then counts the lines and writes the answear out. 2) I made the first part like this: ...
3
by: Abhas | last post by:
> > Hi, this is Abhas, > > I had made a video library program in C++, but was facing a problem. > > After entering 12 movies, i cannot enter any more movies. > > Something gibberish comes instead....
1
by: raydelex | last post by:
I am new to securing a database with logins. My questions is: I want only one database to use a new Workgroup file that I have created, not all the Access databases that I bring up under my...
19
by: wetherbean | last post by:
Hi group..I am writing a playlist management protocol where I have a file that holds all the playlists and a file that holds all the songs....before a playlist is created I need to check to see if...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.