Sudhakar
Sudhakar

Reputation: 21

(ASP.NET 2008) opens the file within browser rather than showing a Open/SaveAs dialog

we have image files in IIS6.0 server, and wanted to open in browser using ASP.NET2008.

My problem is that it always shows the open/saveas dialog, but what I wanted is, it should open the file in the browser directly. we are using ASP.NET2008. It would be great if you provide the sample code.

thanks

Upvotes: 0

Views: 162

Answers (1)

KB22
KB22

Reputation: 6979

You could try to embed those file(s) into a simple HTML page. This will make browsers display it without prompting the user.

Making your code output bare bones like:

<html>
<head><title>YOUR_IMAGE_NAME</title></head>
<body>
  <img src = 'YOUR_IMAGE' alt='YOUR IMAGE DESC' />
</body>
</html>

to the browser should be sufficent.

HTH

Upvotes: 1

Related Questions