By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

image resize / database

P: 67
I finally figure out how to resize an image. I now want to put this image in a database. So far i have created an image resource, do i need to output this to a file before i can store it into the database imagejpeg($resource, $file); if this is the case how do i go about deleteing the $file after i have stored the image?
Aug 3 '07 #1
Share this Question
Share on Google+
2 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Shawn.

Check out the unlink() function.
Aug 4 '07 #2

kovik
Expert 100+
P: 1,044
You don't need to output it to a file. You can output it directly to the screen. The bad thing about the GD library is that you don't have the option of saving the output to a variable instead of the screen, so if you use the output buffer, you can get the contents of the new file.

i.e.

[php]ob_start();
imagejpeg($imageResource);
$fileData = ob_get_clean();[/php]
Aug 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.