I have a website where people fill out a form and submit their resume which is then emailed to me. When they submit their resume it stores it on the server in the same folder as the website.
How can I get it to store the uploaded files in a different folder, say called “resumes”?
this is the script for the page:
[CODE]
<?php
include “MIME.class”;
define(‘TO’, ‘[email protected]’); # CHANGE THIS TO A REAL ADDRESS (yours?)
// Has there been a form submission? If yes, go on and
// process…
if (is_array($HTTP_POST_VARS)) {
if ($resume != ‘none’) {
$fname = ‘./’.$resume_name; // make a real filename
// Get the content-type of the uploaded file
if (preg_match(“!/x-.+!i”, $resume_type))
$type = OCTET;
else
$type = $resume_type;
$from = sprintf(“‘%s’ <%s>”, $name, $email) ;
copy($resume, $fname); //do error checking if need
$mime = new MIME_mail($from, TO, ‘online application form’, “Please find attached the resume from the online application form from $name”, “Cc: $email”);
$mime->fattach($fname, “Resume of $name”, $type);
$mime->send_mail();
} else {
echo “Dear $name<p>You have not submitted your resume. Please use the browse button to attach it and click send!<br>”;
}
}
?>