上传文件报错
本帖最后由 sspghost 于 2014-01-21 17:23:00 编辑 有的文件上传就没问题,有的文件上传就会报错比如
Warning: move_uploaded_file(D:/xampp/htdocs/ca/doc/新.txt): failed to open stream: Invalid argument in D:\xampp\htdocs\ca\do_upload.php on line 22
Warning: move_uploaded_file(): Unable to move 'D:\xampp\tmp\php3BF8.tmp' to 'D:/xampp/htdocs/ca/doc/新.txt' in D:\xampp\htdocs\ca\do_upload.php on line 22
Stored in: D:/xampp/htdocs/ca/doc/新.txt这里的line22是下面代码的第13行
如果把这个txt的名字改成新建文本文档的话就没问题...这是为啥啊
<?php<br />if ($_FILES["upload_file"]["error"] > 0)<br /> {<br /> echo "Return Code: " . $_FILES["upload_file"]["error"] . "<br />";<br /> }<br /> else<br /> {<br /> echo "Upload: " . $_FILES["upload_file"]["name"] . "<br />";<br /> echo "Type: " . $_FILES["upload_file"]["type"] . "<br />";<br /> echo "Size: " . ($_FILES["upload_file"]["size"] / 1024/1024) . " MB<br />";<br /> echo "Temp file: " . $_FILES["upload_file"]["tmp_name"] . "<br />";<br /><br /> move_uploaded_file($_FILES["upload_file"]["tmp_name"],<br /> "D:/xampp/htdocs/ca/doc/" . $_FILES["upload_file"]["name"]);<br /> echo "Stored in: " . "D:/xampp/htdocs/ca/doc/" . $_FILES["upload_file"]["name"];<br /> }<br /> $name=$_FILES["upload_file"]["name"];<br /> $size=floor($_FILES["upload_file"]["size"] / 1024/1024 )."MB";<br /> $loc="doc/" . $_FILES["upload_file"]["name"];<br /> echo "<br/>";<br />?>
Salin selepas log masuk