acuro Posted September 24, 2007 Share Posted September 24, 2007 Hi all, Just joined this forum and have a question to a problem that I am having. I've recently upgraded to the latest PHP release. The problem is on a job application form. When submitting the form with a resume attached, there's no error. An email comes back with a link to download the resume, but the file is always missing. It never gets uploaded to the server. Has anybody having same issues or encounter something like this recently? If you have can you please share a possible solution or can someone relate this to a similar issue. Thanks in advance for your time and support. Quote Link to comment https://forums.phpfreaks.com/topic/70497-file-attachment-mistery/ Share on other sites More sharing options...
Wuhtzu Posted September 24, 2007 Share Posted September 24, 2007 Please show us some code Quote Link to comment https://forums.phpfreaks.com/topic/70497-file-attachment-mistery/#findComment-354156 Share on other sites More sharing options...
acuro Posted September 24, 2007 Author Share Posted September 24, 2007 Here's the code from my application form, hope this helps: <?php require_once('../connect/connect.php'); ?> <?php function RecursiveMkdir($path) { if (!file_exists($path)) { RecursiveMkdir(dirname($path)); mkdir($path, 0777); } } // Validation if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email)) { header("Location: file.php"); exit; } if( $resume_Size == 0) { header("Location: file.php"); exit; } if( $resume_Size >2000000) { //delete file unlink($resume_Temp); header("Location: file.php"); exit; } if( $resume_Mime_Type != "application/msword" AND $resume_Mime_Type != "application/pdf" AND $resume_Mime_Type != "application/vnd.ms-excel" AND $resume_Mime_Type != "text/plain" ) { unlink($resume_Temp); header("Location: file.php"); exit; } // random 4 digit to add to our file name $random_digit=rand(0000,9999); $newresume_Name=$random_digit.$resume_Name; $uploadFile = "folder/".$newresume_Name; if (!is_dir(dirname($uploadFile))) { @RecursiveMkdir(dirname($uploadFile)); } else { @chmod(dirname($uploadFile), 777); } @move_uploaded_file( $resume_Temp , $uploadFile); @chmod($uploadFile, 644); //combine random digit to you file name to create new file name //use dot (.) to combile these two variables $resume_URL = "http://www.mysite.com/folder/".rawurlencode($newresume_Name); ?> Quote Link to comment https://forums.phpfreaks.com/topic/70497-file-attachment-mistery/#findComment-354174 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.