file open with web app

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGF1bA==?=

    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.
  • =?Utf-8?B?UGF1bA==?=

    #2
    RE: file open with web app

    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.

    Comment

    • Patrice

      #3
      Re: file open with web app

      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\m yfile.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" <Paul@discussio ns.microsoft.co ma écrit dans le message de groupe de
      discussion : 9B8BEAC9-F4DB-4DF5-B049-E69E04763CDD@mi crosoft.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.

      Comment

      • =?Utf-8?B?UGF1bA==?=

        #4
        Re: file open with web app

        thanks for the response, that seems to be the problem.
        string abstpath = Server.MapPath( newpath + FileUpload1.Fil eName);
        "C:\\folder1\\f older2\\filenam e"
        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\m yfile.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" <Paul@discussio ns.microsoft.co ma écrit dans le message de groupe de
        discussion : 9B8BEAC9-F4DB-4DF5-B049-E69E04763CDD@mi crosoft.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.
        >
        >
        >

        Comment

        • =?Utf-8?B?UGF1bA==?=

          #5
          Re: file open with web app

          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\m yfile.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" <Paul@discussio ns.microsoft.co ma écrit dans le message de groupe de
          discussion : 9B8BEAC9-F4DB-4DF5-B049-E69E04763CDD@mi crosoft.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.
          >
          >
          >

          Comment

          • Patrice

            #6
            Re: file open with web app

            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 programmaticall y
            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" <Paul@discussio ns.microsoft.co ma écrit dans le message de groupe de
            discussion : B4127F3F-BD66-417C-9E5C-576F81BABB49@mi crosoft.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.

            Comment

            Working...