Jump to content

Unlinking dynamic images...


irx

Recommended Posts

Hello

I am having trouble deleting a user uploaded image after I am done with it. I need to be able to delete the image immediatly off my server as soon as the editing is done.

 

heres my code

 

Code:

$Img = ImageCreateFromJPEG($path);
$cor = imagecolorallocate($Img, 154, 41 ,45);
imagestring($Img, 2, 580, 550, $name,$cor);
header('Content-type: image/jpeg');
imagejpeg($Img, NULL, 100);
imagedestroy($Img);
unlink($path);

 

I believe it has something to do with the fact that I am reoutputting the image to browser, and therefore my unlink is useless. Is there a workaround?

 

Link to comment
https://forums.phpfreaks.com/topic/105802-unlinking-dynamic-images/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.