Hi,
I am trying to use the Upload Class available at http://www.phpbuilder.com/snippet/d...ppet&id=394
I have renamed from Download.php to Upload.class.php, and have included it in the page I need to refer to it from, along with the code:
require_once("Upload.class.php");
$upload = new Upload();
$upload->printFormStart("index.php");
// put as many of these in as you want,
// pass a string filename, else a default is used.
$upload->printFormField();
print"<br />";
//$upload->printFormField();
$upload->printFormSubmit();
$upload->printFormEnd();
if ($submit) {
$upload->setAllowedMimeTypes(array("image/bmp","image/gif","image/pjpeg","image/jpeg","image/x-png"));
$upload->setUploadPath("http://www.mysite.co.uk/Temp/Images");
if ($upload->doUpload()) {
print "Files Uploaded!";
} else {
$errors = $upload->getUploadErrors();
print "<strong>::Errors occured::</strong><br />\n";
while(list($filename,$values) = each($errors)) {
"File: " . print $filename . "<br />";
$count = count($values);
for($i=0; $i<$count; $i++) {
print "==>" . $values[$i] . "<br />";
}
}
}
}
I have set the chmod permissions on the folder to allow write access, but nothing gerts written to the folder. I get no success or error messages as I would expect. I do get redirected to index.php, and it all looks as if it had worked, but as I say, nothing gets uploaded.
Am I doing it right by setting:
$upload->setUploadPath("http://www.mysite.co.uk/Temp/Images");
??? Has anyone else used this script and been able to get it fully working? I did email the author, but so far no reply.
Cheers,
Al