Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/70497-file-attachment-mistery/
Share on other sites

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);


?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.