vc客户端向php server端post abc.txt文件,但在php server端的upfiles目录下未生成abc.txt文件,用Fiddler抓包,发现php server端返回http 200,post的abc.txt文件内容也有,为啥server收不到呢?请高手指点。非常感谢!
abc.txt文件内容:
verify:local
id:1111
host:2.2.2.2
id:2222
host:3.3.3.3
id:3333
host:4.4.4.4Fiddler抓包截图:php server端代码:
<?php
$uploadfile = "upfiles/". $_FILES['upfile']['name'];
move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadfile);
?>
abc.txt文件内容:
verify:local
id:1111
host:2.2.2.2
id:2222
host:3.3.3.3
id:3333
host:4.4.4.4Fiddler抓包截图:php server端代码:
<?php
$uploadfile = "upfiles/". $_FILES['upfile']['name'];
move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadfile);
?>
$uploadfile = "upfiles/". $_FILES['upfile']['name'];
echo move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadfile);
?>
检查upfiles目录的权限,用户是否有写权限?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<H1>文件上传</H1>
<form enctype="multipart/form-data" action="upload.php" method="post">
<input name="upfile" type="file"><BR>
<input type="submit" value="Submit">
</form>
<body>
</body>
</html>