我在这里尝试从html表单上传PDF文件。但该文件未上传。
HTML文件:
<form action="Upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="fileToUpload" accept="application/pdf" id="fileToUpload">
<input type="submit" value="Upload" name="submit">
</form>
Upload.php文件:
move_uploaded_file ($_FILES['fileToUpload'] ['tmp_name'], "uploads/{$_FILES['fileToUpload'] ['name']}");
答案 0 :(得分:0)
检查您是否在根目录中创建了“upload”文件夹。
答案 1 :(得分:-1)
在upload.php中修改
move_uploaded_file ($_FILES['fileToUpload'] ['tmp_name'], "uploads/".$_FILES['fileToUpload'] ['name']);
&#13;