enembee Posted October 23, 2013 Share Posted October 23, 2013 I've been having some trouble with this particular script as it will not accept that the file I am trying to upload is an RTF file. I have used both my own version of the script and the version from the official answers that I downloaded from this site. I am running PHP version 5.5.5 and the script is going to the invalid file type section of the IF statement. The file I am trying to upload has the .rtf extension as I understand is required, has anyone else had this problem? Link to comment Share on other sites More sharing options...
phpstuff Posted October 24, 2013 Share Posted October 24, 2013 Can you upload any file type? Link to comment Share on other sites More sharing options...
Larry Posted October 24, 2013 Share Posted October 24, 2013 One step I would take would be to have PHP print the file type of the uploaded file. That way you can see what PHP thinks it is. Link to comment Share on other sites More sharing options...
enembee Posted November 12, 2013 Author Share Posted November 12, 2013 Hi, apologies for the slow reply. I have printed the file type that is being uploaded with the error message and it is coming back as: text/plain The file is showing up as Rich Text Document in Windows Explorer with the .rtf extension. Is the problem here with the file itself or my IF statement which is looking for a text/rtf file? Link to comment Share on other sites More sharing options...
Larry Posted November 14, 2013 Share Posted November 14, 2013 The problem could either be with the file itself or with the browser's identification of it. What browser gave that result? Do other browsers give the same result? Link to comment Share on other sites More sharing options...
enembee Posted November 14, 2013 Author Share Posted November 14, 2013 I think it must be the file itself, I just created it in notepad and saved it with the .rtf extension. I found a sample rtf file online and that works fine. I got this result in Chrome, Firefox, and IE. Link to comment Share on other sites More sharing options...
Larry Posted November 15, 2013 Share Posted November 15, 2013 Okay. Good debugging! Link to comment Share on other sites More sharing options...
Recommended Posts