我的服务器去了/ var / www / html / uploads。我尝试在上传之前放一些,但它们似乎没有起作用。
if ($_FILES['photo']['name']) {
$valid_file = true;
if (!$_FILES['photo']['error']) {
$new_file_name = strtolower($_FILES['photo']['name']);
$pathImage = SITE_ROOT . '/uploads/' . $new_file_name;
if ($_FILES['photo']['size'] > (1024000)) { // Maximum 1MB
image
$valid_file = false;
$message = 'Oops! Your file\'s size is to large.';
}
if ($valid_file) {
move_uploaded_file($_FILES['photo']['tmp_name'], $pathImage);