为什么在将文件上传到PHP时$_file是空的?我的Windows 7计算机上安装了WampServer 2。我使用的是Apache2.2.11和PHP 5.2.11。当我试图从表单上传任何文件时,它似乎是在上传,但是在PHP中,$_FILES数组为空。中没有文件。c:\wamp\tmp文件夹。我已经配置了php.ini若要允许文件上载等,请执行以下操作。这个tmp文件夹具有当前用户的读写权限。我很困惑。HTML:<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>
<form enctype="multipart/form-data" action="vanilla-upload.php" method="POST">
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form></body></html>PHP:<?php
echo 'file count=', count($_FILES),"\n";var_dump($_FILES);echo "\n";?>
3 回答
慕侠2389804
TA贡献1719条经验 获得超6个赞
enctype="multipart/form-data"
php.ini
php.ini
php.ini
upload_max_filesize
post_max_size
file_uploads = On; sounds like you already did thispost_max_size = 8M; change this higher if needed upload_max_filesize = 8M; change this higher if needed
"c:\wamp\tmp"
php.ini
慕村9548890
TA贡献1884条经验 获得超4个赞
enctype="multipart/form-data"
<form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"></form>
- 3 回答
- 0 关注
- 1017 浏览
添加回答
举报
0/150
提交
取消