外我公司目前有以下幾種:move_uploaded_file地方文件的目標目錄
if (in_array($_FILES['userfile']['type'], $mimeTypes))
{
$target_path = "./uploads/{$_SESSION['email']}";
$target_path = $target_path . basename($_FILES['userfile']['name']);
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $target_path)) {
echo "The file ". basename($_FILES['userfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
當有人創建一個登錄,爲用戶使用他們的電子郵件,0666權限創建的目錄。
當前,move_uploaded_file()將文件放在用戶目錄的頂部,位於uploads目錄中。錯誤正在拋出。我多次檢查過我的相對路徑是否正確。
我使用的是Ubuntu,上傳的文件上有一個Lock符號,但可以拖放到用戶的文件夾中。
你明白了!是的,我chmod回到755.我試圖讓這個工作不同的權限。 – V1GG3N 2012-08-01 01:39:31