jackofalltrades Posted February 23, 2009 Share Posted February 23, 2009 I am stumped as to why I am getting this error only with these filetypes. I have attached my php code. Any help greatly appreciated. Thank you for any help you can give. I really appreciate it. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 23, 2009 Share Posted February 23, 2009 The code displays the same error if the $attachment_Size == 0, $attachment_Size >50000, and $attachment_Mime_Type is not one of the listed values. How do you know from that which condition is failing? You need unique error messages for each possible condition. The $attachment_Size == 0 will also be true for upload errors, which you need to check first before you access any of the uploaded file information - http://us2.php.net/manual/en/features.file-upload.errors.php Also, when a test fails, you need to display the value that is failing so you get feed back as to why it failed. If the $attachment_Mime_Type test fails, display $attachment_Mime_Type in the error message so that you can see what value it has in it. You also don't need to unlink() the temporary uploaded file because it is automatically destroyed when the script ends. Quote Link to comment Share on other sites More sharing options...
Brian W Posted March 25, 2009 Share Posted March 25, 2009 funny he would post again his same problem... good catch PFMaBiSmAd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.