locked
How to Open PDF from External Driver/folder using asp.net webpage? RRS feed

  • Question

  • User-1640542475 posted
    Hi
    
    I need to open PDF file  which are stored in different Server in same network
    envoironment using asp.net webpage
    
    Please advice me.
    
    Thank you 
    Maideen



    What I did it
    
            Dim embed As String = "<object data=""{0}"" type=""application/pdf"" width=""100%"" height=""800px"">"
            embed += "If you are unable to view file, you can download from <a href = ""{0}"">here</a>"
            embed += " or download <a target = ""_blank"" href = ""http://get.adobe.com/reader/"">Adobe PDF Reader</a> to view the file."
            embed += "</object>"
            'ltEmbed.Text = String.Format(embed, ResolveUrl("Finance_Report_Invoice.pdf"))
            ltEmbed.Text = String.Format(embed, ResolveUrl(Me.txtFilePath.Text))
    
    
    Inside the application Folder - No issue, can view on ASP.net page
    
    ../Doc_Uploads/FormsOLController.pdf
    
    
    external Drive in same Network (In premise) cannot Open or view in ASP.net page
    
    \\Sils-home\j-disk-3\pdf\FormsOLController.pdf


    </div>

    Friday, February 5, 2021 2:12 AM

Answers

  • User1535942433 posted

    Hi maideen5,

    According to your description,I think you could access the file share.

    To access a network folder, we need to make sure the ASP.NET process identity has permission on this network folder and make sure the account is in the Access this computer from the network group on remote server.

    More details,you could refer to below article:

    https://forums.asp.net/t/1934712.aspx?Correct+way+to+access+a+file+share

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 5, 2021 7:42 AM

All replies

  • User-1545767719 posted

    If you can assign the access right to the worker process of web application so that the worker process can read the PDF file, I suggest that you add an http generic handler to which a user can access and download the requested PDF file.

    Friday, February 5, 2021 3:04 AM
  • User1535942433 posted

    Hi maideen5,

    According to your description,I think you could access the file share.

    To access a network folder, we need to make sure the ASP.NET process identity has permission on this network folder and make sure the account is in the Access this computer from the network group on remote server.

    More details,you could refer to below article:

    https://forums.asp.net/t/1934712.aspx?Correct+way+to+access+a+file+share

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 5, 2021 7:42 AM