Results 1 to 6 of 6
Thread: Which File to "unlink"?
Mar 19, 2013, 07:50 #1
- Join Date
- Aug 2010
- 1 Post(s)
- 0 Thread(s)
Which File to "unlink"?
From another discussion...
Towards the top of my script I have...
// Valid Form Data.
// No File.
$errors['upload'] = 'Choose a File.';
// File exists.
$tempFile = $_FILES['userPhoto']['tmp_name'];
// Invalid Form Data.
// Drop through to display Errors.
}//End of CHECK FOR FILE
In a lot of my "upload.php" script I use $tempFile to check if the uploaded photo is "clean".
But then once I start working with GD, I am working a lot with functions which create an "Image Resource Identifier".
So what about these snippets of code...
$origImage = @imagecreatefromgif($tempFile);
$newTrueColorImage = @imagecreatetruecolor($newWidth, $newHeight);
$resizedImage = @imagecopyresampled($newTrueColorImage, $origImage, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);
$newPhoto = @imagegif($newTrueColorImage, $newFilePath);
Based on my understanding of things, it seems like I need to delete either $_FILES or $_FILES['userPhoto']['tmp_name'] at the very end of my script like this...
But what about the intermediary "Image Resource Identifiers"??
And maybe there are some other files I am missing??