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.
Basically, the upload function stopped working right after we upgraded to PHP 5.2.3
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.
Here's some of the code if you think you can help me figure this out.
<?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);
?>