I want to open a pdf which is exists in the client system or client network from my web application.

Last post 09-27-2006 12:34 PM by dfields. 4 replies.

Sort Posts:

  • I want to open a pdf which is exists in the client system or client network from my web application.

    09-21-2006, 4:35 AM
    • Loading...
    • chencham_raju
    • Joined on 07-18-2006, 7:06 AM
    • Hyderabad
    • Posts 2

    Hi,

     

    I have a requirement, i want to open a pdf file which is exists in the client place from my web application..

    i tried this by using anchor tag, but it is not working fine..

    <a href="c:\one.pdf" target="_blank">Opening PDF File</a>

    it is not working fine..

    if i write this code in .html file then it is opening file, if i write the code in .aspx file then it is not opening fine..

    this is a urgent requirement to me.. kindly help me in this..

     

    regards,

    Raju

     

     

  • Re: I want to open a pdf which is exists in the client system or client network from my web application.

    09-21-2006, 8:42 AM
    • Loading...
    • Curt_C
    • Joined on 07-23-2003, 8:27 PM
    • Stevens Point, WI - USA
    • Posts 4,293
    • Moderator
      TrustedFriends-MVPs

    you cant.... the clients files/filesystem aren't accessible.

    You can TRY to use a file:///c:\file.ext type hyperlink but it's got a good chance the browser won't render it right anyway...

    Curt Christianson
  • Re: I want to open a pdf which is exists in the client system or client network from my web application.

    09-21-2006, 9:10 AM
    • Loading...
    • dfields
    • Joined on 08-04-2006, 10:53 AM
    • Posts 99

    The file cannot be below the directory that is mapped as the root directory for the root application on the webserver.  Example:

    If you have an application on the sever at:

    C:\Inetpub\wwwroot\MyApplication\

    And that application is mapped to the domain:

    http://www.myapplication.com/

    Then you cannot link to any files below C:\Inetpub\wwwroot\MyApplication\.

    The simple solution here is to copy these files to the root directory for the root application, or a sub directory therein.

    If that is not an option then your best bet would be to create a generic handler page (a .ashx page), that can do a binary read/write of a specified file anywhere on the server, and change the mime-type of file (by setting the Response.ContentType) to "application/pdf."

    -- Dan

  • Re: I want to open a pdf which is exists in the client system or client network from my web application.

    09-27-2006, 9:33 AM
    • Loading...
    • chencham_raju
    • Joined on 07-18-2006, 7:06 AM
    • Hyderabad
    • Posts 2

    Hi, again this is raju.

     I have a previous version code of my project, that is in asp. in this code they are given like this response.reditect("c:/temp/one.pdf");

    it is working fine..

     

    My actual problem is my client is having some document repository. that ia located at the server place. that will be fine. but some type of documents that client will release some CD's with documents they will paste those documents in cleint system or in cleint network system. at the time of document openig i need to display that client side pdf file.

     this is a very urgent requirement please give some response to me..

     

    regards,

    Raju

  • Re: I want to open a pdf which is exists in the client system or client network from my web application.

    09-27-2006, 12:34 PM
    • Loading...
    • dfields
    • Joined on 08-04-2006, 10:53 AM
    • Posts 99

    1.) Then you will have to create a scheduled batch file to RoboCop the files to a directory that is accessible to the web application...

    OR

    2.) Implement the generic handler solution described above only replace .ashx with .asp.


    You could also create a service that watches the document repository for changes and copies files in near-realtime.  This solution is similar to #1 above, only it provides access to the documents faster because it is constantly running, and it is more scaleable.

    -- Dan 

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter