xxxxxxxxxx
increase the value of both variables in php.ini (post_max_size and upload_max_filesize)
xxxxxxxxxx
if (move_uploaded_file($tmp_name, $uploadfile)) {
//do some code if file properly moved
}else {
echo "File could not be successfully moved!<br>";
}
xxxxxxxxxx
<?php
$uploads_dir = '/uploads';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
// basename() may prevent filesystem traversal attacks;
// further validation/sanitation of the filename may be appropriate
$name = basename($_FILES["pictures"]["name"][$key]);
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
}
?>