Link to home
Start Free TrialLog in
Avatar of Cem Türk
Cem TürkFlag for Türkiye

asked on

PHP thumbnail generation and IE Save As

Hello guys,

i have made an img.php that generates thumbnails for my images, and resize big images to 640x480.
i use

header('Content-Disposition: inline; filename=' . $fn); //$fn stands for file name

to save images with their original names while using Save As.

But when i add the images into another page using img tag or iframe it Save As doesnt work as expected. It tries to save as untitled.bmp

Here are 2 URLs one to a pop up page. and one to the image itself.
http://online.rek-man.com/pop.php?path=/REFLEX%20STOKLAR%20(AVRUPA)/50492_1_RGB.jpg&rt=stok
http://online.rek-man.com/inc/img.php?img=/REFLEX%20STOKLAR%20(AVRUPA)/50492_1_RGB.jpg&rt=stok

I have read a few articles to prevent IE saving images as untitled.bmp but they did not work.
what can be wrong?
 
Avatar of DelTreme
DelTreme

Using IE I get the same behavior you described, in an img tag it just calls itself image.bmp. FireFox does rename it well in both ways.

Did you add
header('Content-Type: image/jpg');
(or was it image/jpeg)
to your code? That should at least get rid of the bmp thing
Avatar of Cem Türk

ASKER

Thanks for your reply.
its already  image/jpeg :)
i am just reading a jpg file from a directory and output it to browser via
 ImageJPEG function.
What about content-disposition: attachment?

--
Lee
i tried that before. when img.php is used as an iframe it tries to save the file with the correct name :) but it doesnt make any differance in image tag. I think its something with IE reading image source headers, because it works correct in most browsers except IE.
Oh no, I didn't read the original question right, sorry.  

'Save as' on an IMG element resulting in untitled.bmp is definitely not a server issue. Try clearing your temporary internet files first, then reset web settings.

http://support.microsoft.com/?kbid=260650 - Temporary Internet Files folder is full or you are using HTTPS and the images are not cached.  Possibly your images are not cached anyway using HTTP response directives like "pragma:no-cache" etc.

If the original file is not cached, all IE will have is a bitmap representation.  Other browsers ignore pragma:no-cache.

http://support.microsoft.com/?kbid=810978 - May also be the result of a damaged plug in.

--
Lee





i have already read that kb articles too. still no use :]
So, what http headers are being returned for that Image?  You'll need to use a tool like http://www.blunck.se/iehttpheaders/iehttpheaders.html to prove.

--
Lee
ASKER CERTIFIED SOLUTION
Avatar of Cem Türk
Cem Türk
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial