我想要一個用戶上傳他的簡歷,該簡歷將被保存到我的服務器上併發送一封包含該鏈接的電子郵件。但由於某種原因文件沒有上傳。請幫忙。該文件沒有上傳到服務器上
這裏是我的代碼:
<?php
//This function separates the extension from the rest of the file name and returns it
function findexts ($filename)
{$filename = strtolower($filename);
$exts = split("[/\\.]", $filename);
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;}
//This applies the function to our file
$ext = findexts ($_FILES['uploaded']['name']);
//This line assigns a random number to a variable.
$ran = rand();
//This takes the random number (or timestamp) you generated and adds a . on the end
$ran2 = $ran.".";
//This assigns the subdirectory you want to save into... make sure it exists!
$target_path = "/resume/";
//This combines the directory, the random file name, and the extension
$target_paths = $target_path . $ran2.$ext;
move_uploaded_file($_FILES['uploaded']['tmp_name'], $target_path);
$file_name="http://www.mydomain.com".$target_paths;
?>
檢查文件夾權限?你得到什麼錯誤? – j08691
沒有錯誤顯示。直接向我提供的電子郵件地址發送一封郵件,我在服務器上創建的文件夾顯示爲空,並且你說了什麼權限,我很抱歉,我對此很陌生 – Himani
該文件夾需要來自用戶的寫入權限web服務器運行如下: – j08691