There is a feature on my site where admin is able to login and upload their weekly bulletin. The file is a pdf file. When I convert the original (Publisher) file to pdf from my PC and upload it there is no problem, however, when my client tries to convert and upload it the program rejects it as a uploadable file. I even had her send me her pdf file and I had the same error when I tried to upload it myself. Can you tell me why it would work with my computer but not hers?

// Check for file upload.
        if (is_uploaded_file ($_FILES['userfile']['tmp_name']))
         {
             if (move_uploaded_file($_FILES['userfile']['tmp_name'], "../bulletin/weekly-bulletin.pdf"))
            { // Move the file over.
               echo '<p><font color="red">Your file has been uploaded successfully!</font></p>';
           }
           else
           { // Couldn't move the file over.
               echo '<p><font color="red">Your file could not be uploaded.</font></p>';
               }
         }
         else
         { 
         echo '<p><font color="red">Your file is not an uploadable file.</font></p>';
         }
   }

    Perhaps the max upload filesize is being exceeded?

    ~Brett

      bpat1434 wrote:

      Perhaps the max upload filesize is being exceeded?

      ~Brett

      I have run into this problem before also and it was due to the max upload. I would ask the hosting provider if they can bump it up a bit, but they dont always say yes.

        Nope, that's not it. The file size of both pdf files is identical. Any other ideas ???? 🙂

          What errors do you get? Your own custom errors, or PHP errors?

          ~Brett

            My own. "Your file is not an uploadable file." (code is on my original post)

              try echoing out $_FILES['userfile']['error'] if the file isn't uploaded. See what that gives you.

              ~Brett

                It simply comes back with "2". What does that mean?

                  Thanks so much! I LOVE THIS FORUM!!!

                    Write a Reply...