关于文件上传的问题(上传成功,但是找不到文件)
写了一个文件上传小测试,如下:
<form action="form.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100000000">
<input type="file" name="spic"> <br>
<input type="submit" name="sub" value="upload file"><br>
<?php
if(is_uploaded_file($_FILES['spic']['tmp_name'])){
echo "<pre>";
print_r($_FILES);
move_uploaded_file($_FILES['spic']['tmp_file'],'F:/appserv/www/');
echo "上传成功";
echo "</pre>";
}
?>
</form>
运行随意上传了个文件,结果如下:
[pre]Array( [spic] => Array ( [name] => upload.php [type] => application/octet-stream [tmp_name] => F:\Temp\phpA404.tmp [error] => 0 [size] => 315 ))上传成功但是在文件夹里并没有找到上传的文件那(听说是win7权限的问题,更改了权限完全控制,但是还是不管用)还请多指教,非常感谢!!![/pre]
<form action="form.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100000000">
<input type="file" name="spic"> <br>
<input type="submit" name="sub" value="upload file"><br>
<?php
if(is_uploaded_file($_FILES['spic']['tmp_name'])){
echo "<pre>";
print_r($_FILES);
move_uploaded_file($_FILES['spic']['tmp_file'],'F:/appserv/www/');
echo "上传成功";
echo "</pre>";
}
?>
</form>
运行随意上传了个文件,结果如下:
作者: jackyfirst 发布时间: 2011-09-17
给个名字试试
move_uploaded_file($_FILES['spic']['tmp_file'],'F:/appserv/www/a.jpg');
move_uploaded_file($_FILES['spic']['tmp_file'],'F:/appserv/www/a.jpg');
作者: 白老师 发布时间: 2011-09-19
move_uploaded_file($_FILES['spic']['tmp_file'],'F:/appserv/www/');
路径有问题了
路径有问题了
作者: 邵松 发布时间: 2011-09-19