/    Sign up×
Community /Pin to ProfileBookmark

how do you store form email files in a folder on the server?

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>”;
}
}
?>
[/CODE]

to post a comment
PHP

1 Comments(s)

×

Success!

Help @matt00 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...