我有一個html上傳表單。它在我的本地主機上工作。但它不適用於現場服務器。它將信息插入數據庫,但不會將文件上傳到名爲「照片」的文件夾。Php文件沒有上傳到文件夾
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?
你有足夠的文件上傳權限嗎? – 2013-02-25 06:24:38
檢查路徑和權限 – Samy 2013-02-25 06:25:51
我沒有看到。上傳文件的權限是什麼?它只是寫,讀嗎? – 2013-02-25 06:25:53