Forum Moderators: coopster
and upload3.php
<?
$target = "/home/areabulnet/public_html/uploads/";
for($i = 0; $i < 5; $i++){
$target = $target . basename( $_FILES['uploadFile'.$i]['name']) ;
echo $target;
$ok=1;
//This is our size condition
if ($uploaded_size > 1280000)
{
echo "Sorry Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if (isset($uploaded_type) && $uploaded_type =="text/jpg")
{
echo "Not an approved file type.";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploadFile'.$i]['tmp_name'], $target))
{
echo "The file ". basename( $_FILES[’uploadFile’.$i][’name’]). " has been uploaded. ";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
}
?>
Thanks in advance for replies
regards
Fred