Open pdf/jpg/png/jepg file MVC C# from Database

Anonymous
2022-02-11T12:45:18.863+00:00

How to Open pdf/jpg/png/jepg file MVC C# from Database in PDF viewer inside MVC like below screenshot string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"1000px\" height=\"500px\">"; 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>"; ![173525-image.png][1] [1]: /api/attachments/173525-image.png?platform=QnA

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,779 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,596 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 71,506 Reputation points
    2022-02-11T16:52:25.817+00:00

    in razor its:

        <object data="@Model.PdfUrl" type="application/pdf" width="1000px" height="500px">  
          If you are unable to view file, you can download from <a href="@Model.PdfUrl">here</a>  
         or download <a target = "_blank" href = "http://get.adobe.com/reader/">Adobe PDF Reader</a> to view the file.  
    </object>  
    

    the server download is the similar


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.