I want to open file of type pdf/office/image/video in browser without showing up the save dialoge box. Have you got any idea on implementing it in C# asp.net.
I saw
this link but could not use it in .net MVC c#
How well this works depends on the browser, o/s, and plugins installed. Take PDFs for example. Safari always support displaying because it’s builtin to the o/s. Firefox uses a JavaScript routine to display PDFs.
to display video, you need to render a page that has a media control which a src to the video.
Member
12 Points
138 Posts
Opening file(pdf/office/image/video) without Open or Save dialog box
Jan 05, 2021 05:32 PM|tadbirgaran|LINK
hi
I want to open file of type pdf/office/image/video in browser without showing up the save dialoge box. Have you got any idea on implementing it in C# asp.net.
I saw this link but could not use it in .net MVC c#
All-Star
52971 Points
23574 Posts
Re: Opening file(pdf/office/image/video) without Open or Save dialog box
Jan 05, 2021 06:24 PM|mgebhard|LINK
Viewing documents dependents on what plugins the user has installed and has little to do with C# or ASP.NET.
Images and Videos use standard HTML tags.
https://www.w3schools.com/tags/tag_img.asp
https://www.w3schools.com/html/html5_video.asp
All-Star
58124 Points
15641 Posts
Re: Opening file(pdf/office/image/video) without Open or Save dialog box
Jan 05, 2021 07:17 PM|bruce (sqlwork.com)|LINK
The content-disposition header is the hint to the browser to download or display file.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
How well this works depends on the browser, o/s, and plugins installed. Take PDFs for example. Safari always support displaying because it’s builtin to the o/s. Firefox uses a JavaScript routine to display PDFs.
to display video, you need to render a page that has a media control which a src to the video.