Amish_Geek
01-21-2005, 01:29 AM
Ok, for some reason, my PHP code is no longer working. Can someone take a look at my code and see if anything is wrong? It used to work, but now it doesn't, and I'm trying to figure out how to get it to work again.
Basically, when a user uploads a file, it puts it in the /pics/ dir, and this script then makes a 200x200 thumbnail of it.
I've edited the system path. The script uploads the file just fine, however, it is echoing that it is not able to create the thumbnail.
if (!is_uploaded_file($userfile)) {
echo "Problem: Possible file upload attack";
exit;
}
$upfile = "/path/to/pics/".$go."-".$userfile_name;
$thumbfile = "/path/to/pics/thumbs/".$go."-".$userfile_name;
if (!copy($userfile, $upfile)) {
echo "Problem: Could not move file into directory";
exit;
} else {
$execcmd = "convert -geometry 200x200 " . $upfile . " " . $thumbfile;
echo $execcmd."<hr>";
if (!exec($execcmd)) {
echo "Thumb could not be created";
}
Sorry for the tabs, I copied it right out of dreamweaver.
Basically, when a user uploads a file, it puts it in the /pics/ dir, and this script then makes a 200x200 thumbnail of it.
I've edited the system path. The script uploads the file just fine, however, it is echoing that it is not able to create the thumbnail.
if (!is_uploaded_file($userfile)) {
echo "Problem: Possible file upload attack";
exit;
}
$upfile = "/path/to/pics/".$go."-".$userfile_name;
$thumbfile = "/path/to/pics/thumbs/".$go."-".$userfile_name;
if (!copy($userfile, $upfile)) {
echo "Problem: Could not move file into directory";
exit;
} else {
$execcmd = "convert -geometry 200x200 " . $upfile . " " . $thumbfile;
echo $execcmd."<hr>";
if (!exec($execcmd)) {
echo "Thumb could not be created";
}
Sorry for the tabs, I copied it right out of dreamweaver.
