** php配置是正确的,我看到有人使用这段代码而且工作正常。但在我的情况下,我尝试了很多东西,它从不上传文件,它并没有告诉我有语法错误。
<?php
if (isset($_FILES['file'])) {
$name_file = $_FILES['file']['name'];
$tmp_name = $_FILES['file']['tmp_name'];
$location = "Imagenes/";
move_uploaded_file($tmp_name, $location.$name_file);
}
?>
<form method="POST" action="Upload.php" enctype="multipart/form-data" autocomplete="off">
<div style="margin-top: 50%;">
<label>Inserte la imagen que desee subir:</label>
<input type="file" class="form-control" name="file" id="file">
<input type="submit" style="margin-top: 10px; margin-left: 40%;" class="btn btn-outline-success" name="Upload" value="Upload" required="on">
</div>
</form>**