我有一個表單,用戶可以上傳圖片。我有另一個已經工作的頁面,然後創建一個目錄並將圖像放入其中。出於某種原因,當我複製相同的代碼,以我目前的網頁,它給了我下面的錯誤:爲什麼我不能使用php創建一個目錄?
Warning: mkdir() [function.mkdir]: No such file or directory in /home5/ideapale/public_html/amatorders_final/user_char_upload.php on line 251
這裏是它指的是代碼:
if (!file_exists("../upload/" . $order_id . '_' . $row['last_name'])) { //Checks if the directory already exists
mkdir("../upload/" . $order_id . '_' . $row['last_name'], 0755); //Creates a new directory with the order_id and Customer last name
}
我想呼應了所有這些變量,所以我知道他們的工作。
對我來說這似乎很直接,所以我不知道爲什麼mkdir函數不適合我在這個頁面上工作。任何想法的人?
謝謝!這解決了這個問題,但現在我得到這個錯誤:[function.move-uploaded-file]:無法打開流:HTTP包裝不支持可寫連接 – zeckdude 2011-03-11 12:34:03
You''re welcome :-) ;;那麼,這是另一個問題:你正試圖將文件移動到遠程位置,或類似的東西? *(最終,因爲這是一個明顯的問題,您可能想要問一個不同的問題,代碼示例和所有)* – 2011-03-11 12:35:28