Thanks. This is exactly what I needed. Never save the file, just put it into the db.
egil ----- Original Message ----- From: "Jason Wong" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Wednesday, November 12, 2003 9:17 AM Subject: Re: [PHP] imagejpeg > On Wednesday 12 November 2003 00:34, Egil Berntsen wrote: > > My site need to create some images on-the-fly(with user data) for every > > user but I have some problem with the creating of the jpeg-image. I put > > these images in my MySQL database for later use. This have to do somthing > > with write protection because this is not a problem when I'm working on > > localhost. The problem comes on .com. > > > > I'm trying this: > > $image = imagecreate(100,100); > > {some drawing} > > $fname="filename.jpg"; > > ImageJPEG($image, $fname); > > {database} > > ImageDestroy($image); > > unlink($filename); > > > > And get this: > > Warning: imagejpeg(): Unable to open 'filename.jpg' for writing in ... > > If you're going to be storing it in the DB then there's no need to write to a > file first. Use the output buffer controls (manual > Output Control > Functions) to capture the output of imagejpeg($image) and insert into the DB > (after appropriate sanitation). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > ------------------------------------------ > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > ------------------------------------------ > /* > You have taken yourself too seriously. > */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php