Results 1 to 5 of 5

Thread: Open a file on another server

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved Open a file on another server

    I have a file on another server I want to open in the browser but this does not work:

    Response.Redirect("\\\\ServerName\\Path\\File.pdf");

    How can this be done?
    Last edited by wey97; Nov 10th, 2004 at 09:40 AM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    I know it would be best if the file was in a virtual directory on the same server as the asp.net app and use Server.MapPath() but is there any other way to get access across servers?

  3. #3
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    I think you may need the full physical path.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    Just need to add "file://" to the start

    "file://\\ServerName\\Path\\FileName"

  5. #5
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Firstly the user trying to access the file must have access to the server on the internal network to be able to access the file directly via a browser.

    If you want to serve a file from a server on your internal network to a user not on the same network (e.g. user connecting over the web) then you could use System.IO to stream the file to the browser. If this is what you want let me know and I can supply some sample code.

    DJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width