www.webdeveloper.com
Results 1 to 2 of 2

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

  1. #1
    Join Date
    Nov 2006
    Posts
    22

    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', 'me@myemail.on.net');  # 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>";
    	}
    }
    ?>

  2. #2
    Join Date
    Oct 2006
    Posts
    1,297

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles