Hello,

I am not able to upload PDF files. The server, IIS6, PHP 5.x throws an error of 2 when I try to upload PDF files.

The thing is, the PDF file is well within the size limit that I have set both within maxfilesize and my php.ini. I can upload all other types of files without a problem but PDF's get rejected.

I have not been able to find info on this so I am hoping someone has ran into the issue before.

I am including the code, I am using common code to eliminate extraneous code errors. Insights would be much appreciated as to why I cannot upload PDFs.

FORM CODE
Code HTML4Strict:
<form enctype="multipart/form-data" action="uploader.php" method="POST" name="upload">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file"  /><br />
<input type="submit" value="Upload File" />
</form>

PHP PROCESSING SCRIPT
PHP Code:
echo "<pre>";
print_r($_FILES);
echo 
"</pre>";
// Where the file is going to be placed 
$target_path "resume/";

/* Add the original filename to our target path.  
Result is "resumes/filename.extension" */
$target_path $target_path basename$_FILES['uploadedfile']['name']);

if (
$_FILES["uploadedfile"]["error"] > 0)
  {
  echo 
"Error: " $_FILES["uploadedfile"]["error"] . "<br />";
  echo 
"There was an error uploading the file, please try again!";
  }
else
  {
  echo 
"Upload: " $_FILES["uploadedfile"]["name"] . "<br />";
  echo 
"Type: " $_FILES["uploadedfile"]["type"] . "<br />";
  echo 
"Size: " . ($_FILES["uploadedfile"]["size"] / 1024) . " Kb<br />";
  echo 
"Stored in: " $_FILES["uploadedfile"]["tmp_name"];
    
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path);
    echo 
"The file ".  basename$_FILES['uploadedfile']['name']). 
    
" has been uploaded";

Thank you