views:

146

answers:

2

Hello,

I have a webapplication where I read images from a sql 2008 database through the 'new' filestream functionality. The thing here is, when you right-click and choose save image, IE gives error 800700de while with Firefox it works fine.

The img src is set to a php document which takes a few params to know where to look in the database and then prints the binary data. Please note that displaying the picture works fine in both browsers, this is not the issue. The issue is what I mentioned above.

Any idea why this could be? Is there any solution or a workaround for this?

+2  A: 

Are you building the headers? If so that may be it. What headers are you sending?

Possible appropriate headers via: http://www.electrictoolbox.com/image-headers-php/ GIF:

header('Content-Type: image/gif');

JPEG:

header('Content-Type: image/jpeg');

PNG:

header('Content-Type: image/png');
easement
Solved it, thanks :) sorry for late reply but had much on my hands
Jonas B
A: 

It sounds like IE is going ape because it doesn't quite trust that your file is an image.

If you continue to have problems even after setting the Content-Type headers as others have explained, you can further fool the browser into thinking your script is an image by using a .png or .jpg extension, and then forcing that file to be executed as PHP.

For example, in .htaccess put this to disguise a PHP script as "image.png"

<Files image.png>
ForceType application/x-httpd-php
</Files>
Chris Newman