|
Title: PHP thumbnail generation and img tag Post by: Solamnus on August 21, 2007, 07:20:53 AM 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 with img tag it Save As doesnt work as expected. 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 what can be wrong? Title: Re: PHP thumbnail generation and img tag Post by: rdivilbiss on August 21, 2007, 09:36:01 AM This works: http://www.cafesong.com/test/phpImageStream.php (http://www.cafesong.com/test/phpImageStream.php)
Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PHP Image Stream</title> </head> <body> <code> </code> <p><img border="0" src="http://online.rek-man.com/inc/img.php?img=/REFLEX STOKLAR (AVRUPA)/50492_1_RGB.jpg&rt=stok"></p> <p><iframe name="I1" src="http://online.rek-man.com/inc/img.php?img=/REFLEX STOKLAR (AVRUPA)/50492_1_RGB.jpg&rt=stok">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></p> </body> </html> Title: Re: PHP thumbnail generation and img tag Post by: Solamnus on August 22, 2007, 01:05:56 AM thanks for your reply, your solution works on firefox but does not work on IE6 or IE7.
Unfortunately i am looking for a IE solution to my problem. Thanks again. Title: Re: PHP thumbnail generation and img tag Post by: GrandSchtroumpf on August 22, 2007, 03:13:31 PM > your solution works on firefox
Nice, i did not know you could do that. It also works in Opera and Konqueror. > but does not work on IE6 or IE7. I'm afraid you won't be able to fix IE flaws in your HTML/PHP. Title: Re: PHP thumbnail generation and img tag Post by: rdivilbiss on August 22, 2007, 08:30:26 PM thanks for your reply, your solution works on firefox but does not work on IE6 or IE7. Unfortunately i am looking for a IE solution to my problem. Thanks again. I beg to differ: (http://www.rodsdot.com/images/phpStreamImageIE7.jpg) Title: Re: PHP thumbnail generation and img tag Post by: Solamnus on August 23, 2007, 12:32:06 AM @rdivilbiss
my problem is not to show the image properly. When you right click image and select "Save as" in IE it tries to save the image as "untitled.bmp" i want it to save the image with its original name and format(jpg). Title: Re: PHP thumbnail generation and img tag Post by: GrandSchtroumpf on August 23, 2007, 02:00:24 AM I guess you need to use mod-rewrite to make it work in IE.
With mod-rewrite, you can pass your parameters as "directories" and keep the original file name: http://online.rek-man.com/pop/stok/REFLEX%20STOKLAR%20(AVRUPA)/50492_1_RGB.jpg Title: Re: PHP thumbnail generation and img tag Post by: VGR on August 25, 2007, 07:01:57 AM Solamnus, I had this problem (IE6 at the time) and tried all combinations of content-disposition ; inline ; attachment ; various HTTP headers ; filename= etc etc ad nauseam.
I failed. J'ai renoncé. I suggest you stop losing your time on this IE specific bug. I suggest to add a small-cap message near the images saying (for IE users only, of course) "if your "save as" brings up "untitled.bmp", there's nothing we can do about it. Change for a real browser : Mozilla Firefox." Title: Re: PHP thumbnail generation and img tag Post by: Solamnus on August 27, 2007, 12:53:19 AM @VGR
well i have my work around ready... i am passing the real url of the image, resize proportionally then resize the po up window according to the image. It makes user download more data and that must be the punishment for not using a real browser. Thanks to everyone who replied. Title: Re: PHP thumbnail generation and img tag Post by: VGR on August 27, 2007, 04:03:35 AM this is not really a workaround for the IE problem with "save as" file names, is it ? ;-)
Title: Re: PHP thumbnail generation and img tag Post by: oridan on October 26, 2007, 07:38:00 AM This happens if you send Cache-Control headers prior to initialising the session, and then send further headers after.
From what i know, this happens because in some cases, these initial headers are sent to the browser before they get overwritten later in your php code. Evidently, IE doesnt handle multiple headers with the same key in the same way that Firefox does. I've had this problem for ages I got around this by moving all my header code after the session is started. However its far better not to send multiple headers with the same key unless you really need to. Hope this helps some people, its been a thorn in my side for quite some time! Tom Title: Re: PHP thumbnail generation and img tag Post by: VGR on November 11, 2007, 12:47:29 PM hummmm "cache-control" header serttings mangling "content-disposition" ones ? hummmm are you sure ?
Powered by SMF 1.1 RC2 |
SMF © 2001-2005, Lewis Media
Joomla Bridge by JoomlaHacks.com |