To see the code go to:
http://www.sloppycode.net/sloppycode/PHP/cm13.html
The error I get now is:
Upload class save error: unable to copy to /home/sites/site100/web/parties/images/town.gif
Upload class save error: unable to change permissions for: /home/sites/site100/web/parties/images/town.gif
Some details about the upload:
Filename: town.gif
Mime type: image/gif
File size: 28435
This is how I used the sloppycode (it prints out the details about the file I want to upload correctly but it can't upload in the directory I want it to although the directory exists):
include("clsUpload.php");
$upload = new Upload($HTTP_POST_FILES);
$upload->maxupload_size = 38000;
$location_server=$DOCUMENT_ROOT."/parties/images/";
if ($upload->save($location_server,"file_photo",true))
{
echo "Upload save sucessful.<BR>";
} else{
echo $upload->errors;
}
if ($upload->isPosted)
{
echo "<BR><BR><b>Some details about the upload:</B><BR>";
echo "Filename: ".$upload->getFileName("file_photo")."<BR>";
echo "Mime type: ".$upload->getFileMimeType("file_photo")."<BR>";
echo "File size: ".$upload->getFileSize("file_photo")."<BR>";
}
Thanks for your help,
Chris