Book Now

File Upload

File Upload Form

First Name
Last Name
File
$fileError"; endPage(); } elseif ($fileType != 'text/plain') { echo "You have attempted to upload a file of type: $fileType.
Only text files allowed."; endPage(); } $fileSavePath = 'Resumes/' . $resumeName; if (is_uploaded_file($resumeFile)) { if (!move_uploaded_file($resumeFile,$fileSavePath)) { echo 'Could not save file.'; endPage(); } } else { //This case happens if somehow the file //we are working with was already on the server. //It's to stop hackers. echo 'Hey, what is going on here? Are you being bad?'; endPage(); } $resume=makeFileSafe($fileSavePath); ?>

Thanks!

We got your resume.

'; exit; } function makeFileSafe($filePath) { $fP = @fopen($filePath,'r+'); if (!$fP) { return "Could not read file"; } $contents = fread($fP,filesize($filePath)); $contents = strip_tags($contents); rewind($fP); fwrite($fP,$contents); fclose($fP); return $contents; } ?>