我想要一个用户上传他的简历,该简历将被保存到我的服务器上并发送一封包含该链接的电子邮件。但由于某种原因文件没有上传。请帮忙。该文件没有上传到服务器上
这里是我的代码:
<?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