file open with web app

Discussion in 'ASP .Net' started by Paul, Jun 6, 2008.

  1. Paul

    Paul Guest

    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.
     
    Paul, Jun 6, 2008
    #1
    1. Advertisements

  2. Paul

    Paul Guest

    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.
     
    Paul, Jun 6, 2008
    #2
    1. Advertisements

  3. Paul

    Paul Guest

    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" <> a écrit dans le message de groupe de
    > discussion : ...
    > > 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.

    >
    >
    >
     
    Paul, Jun 6, 2008
    #3
  4. Paul

    Paul Guest

    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" <> a écrit dans le message de groupe de
    > discussion : ...
    > > 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.

    >
    >
    >
     
    Paul, Jun 6, 2008
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. grzybek

    Open file dialog in Web App ( C# )

    grzybek, Dec 4, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    11,425
    grzybek
    Dec 5, 2003
  2. =?Utf-8?B?a3N0cml5aG9u?=

    Open new Internet Explorer window from web service or Web App

    =?Utf-8?B?a3N0cml5aG9u?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    6,615
    Kevin Spencer
    Aug 3, 2005
  3. =?Utf-8?B?bml6YW0=?=

    convert java web app 2 .NET web app

    =?Utf-8?B?bml6YW0=?=, Feb 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    598
    =?Utf-8?B?bml6YW0=?=
    Feb 28, 2006
  4. =?Utf-8?B?bml6YW0=?=

    convert java web app 2 .NET web app

    =?Utf-8?B?bml6YW0=?=, Feb 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    575
    =?Utf-8?B?bml6YW0=?=
    Feb 28, 2006
  5. Replies:
    1
    Views:
    602
    Patrice
    Feb 9, 2007
  6. Mike Cantelon
    Replies:
    0
    Views:
    348
    Mike Cantelon
    Mar 23, 2008
  7. Maras
    Replies:
    0
    Views:
    238
    Maras
    Jun 17, 2004
  8. Peter Sedman

    403 Error Web App to Web App with Client Certificates

    Peter Sedman, Sep 30, 2004, in forum: ASP .Net Security
    Replies:
    18
    Views:
    499
    jlento
    Nov 18, 2004
Loading...