我有一个 html 上传表单。它在我的本地主机中工作。但它不适用于实时服务器。它将信息插入数据库,但不将文件上传到名为“photos”的文件夹。
php代码:
$upload_path = "photos/";
$upload = mysql_query("INSERT INTO photos (photo_cap, photo_name, photo, date)
VALUES('$title','$filenameuniq', '$file', '$uploadate')");
if($upload)
{
if(!empty($file))
{
if(!move_uploaded_file($_FILES['file']['tmp_name'], $upload_path . $filenameuniq))
{
echo '<pre>Your file was not uploaded please try again here are your debug informations:'.print_r($_FILES) .'</pre>';
}
}//// upload to folder
echo "<font color=green>Successfully Updated.</font>";
header("Refresh:2; url=allphotos.php");
exit();
}
调试:
Array ( [file] => Array ( [name] => Blue hills.jpg [type] => image/jpeg [tmp_name] =>
C:\Windows\Temp\php95FB.tmp [error] => 0 [size] => 28521 ) )
Your file was not uploaded please try again here are your debug informations:1
为什么它不上传到“照片”文件夹?在服务器上如何显示 C:\Windows ?