Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
$numoffile = 5; //number of files to upload
[i]//this is the directory you would like the files to go into
// Fix path of your file to be uploaded, don't forget to CHMOD 777 to this folder [/i]
$file_dir = "/var/www/uploaded";
if ($_POST)
{
[i]//if it is a post, loop through the $numoffile[/i]
for ($i=0;$i<$numoffile;$i++) {
if (trim($_FILES['myfiles']['name'][$i])!="") {
[i]//creates the new file name with trimmed spaces[/i]
$newfile = $file_dir.$_FILES['myfiles']['name'][$i];
[i]//moves uploaded file from the tmp directory to the new directory with the file name[/i]
move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile);
$j++;
}
}
}
if (isset($j)&&$j>0)
{
echo ("Your file(s) has been uploaded.<br>");
}
echo ("<form method='post' enctype='multipart/form-data'>");
for($i=0;$i<$numoffile;$i++) {
echo ("<input type='file' name='myfiles[]' size='30'><br>");
}
echo ("<input type='submit' name='action' value='Upload'>");
echo ("</form>");
?>