Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using this code snippet to send an image to client:
C#
Response.ContentType = "image/jpeg";
Response.TransmitFile(Server.MapPath ( @"~\photo.jpeg"));
Response.End();

but the browser shows it itself.
how can i make it open with default image viewer instead of browser?
Posted

1 solution

I am not sure that you can, without writing an activex control or some specific browser plugin. You have sent the file to the client and now it is the client's PC that will determine what opens it. What if they are on a MAC or Linux? Or if they use a phone or tablet. They won't necessarily be using Windows. You have to be more flexible in web programming.
 
Share this answer
 
Comments
thatraja 9-Oct-13 7:35am    
Agree, 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900