Re: Naming image generated by ImageJPEG()

From: Date: Sun, 07 Oct 2001 03:12:41 +0000
Subject: Re: Naming image generated by ImageJPEG()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70270@lists.php.net to get a copy of this message
> This is the script file image.php: > <?php > Header("Content-type: image/jpeg"); > $im = imagecreatefromjpeg("picture.jpg"); > ImageJPEG($im); > ImageDestroy($im); > ?> > > It's called by index.html: <img src="image.php" ... > > > Problem: "Save picture as" results filename image.jpg (IE4) > How can I name the file? There are many different ways, to cover all the browsers. Some Content-disposition: headers, with or without filename= and, for one minor version of IE, you need to do this: <img src="image.php/image.jpg" ...> It looks goofy, but Apache and PHP will ignore it while IE will insist on using the URL as the filename regardless of what headers you send... -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#70270) next »