How to view the file in system default application (eg:doc file in Ms-word ...) without downloading the file?
Loading
How to view the file in system default application (eg:doc file in Ms-word ...) without downloading the file?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tuhin PaulRank #7 · 71.9K reputationPosted Feb 27, 2023, 9:23 PM EST
Hi Gopi,
To view a file in the system default application without downloading it, you can use the Process.Start method in C#. Here's an example code snippet:
using System.Diagnostics; // Replace the file path with the actual file you want to open string filePath = "C:\\example.doc"; // Use the Process.Start method to open the file in the default application Process.Start(filePath);This code will open the file located at filePath in the system's default application for that file type. For example, if filePath points to a .doc file, it will be opened in Microsoft Word.
Vishal JoshiRank #377 · 6.7K reputationPosted Feb 28, 2023, 2:01 AM EST
Hello Gopi
Please check the below documentation to open file pdf/word file in a browser without downloading.
https://learn.microsoft.com/en-US/troubleshoot/developer/webapps/aspnet/development/write-binary-files-browser-csharp
Thanks
Rajeev KumarRank #1,334 · 1.3K reputationPosted Mar 2, 2023, 1:38 AM EST
Hi Gopi Plz Check this-
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 2, 2023, 3:28 AM EST
Hello Gopi,
Please refer this thread,
https://www.c-sharpcorner.com/UploadFile/87b416/reading-ms-word-document-display-in-the-page-in-Asp-Net2/
https://www.aspsnippets.com/Articles/Display-Word-document-in-Web-Page-View-in-ASPNet-MVC.aspx