Docx file format upload issue seems related to server configuration |
[eluser]fran-quero[/eluser]
Hello, I have developed a small application that allows to upload files with some formats: doc, docx, pdf, odt, rtf, txt, etc. It works like a charm, but I made a new installation in a different server, and I get an error when I try to upload a .docx file. As the application is exactly the same, I just can think it may be a server configuration problem, but I don't know what can I check, since the problem doesn't occur when I upload .pdf or .doc files. The exact error I get is: The filetype you are attempting to upload is not allowed. Here is my upload method: Code: private function subir_archivo() And here the docx line in mimes.php: Code: 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'), This same code works in the first server, but not in the new one ![]() I would appreciate any help you can give me, guys. Thank in advance!
[eluser]InsiteFX[/eluser]
Check you cpanel or whatever your hosting provider provides for you there is usally a utility in there that allows you to define your mime types.
[eluser]fran-quero[/eluser]
Thank you for your answer InsiteFX. I have added a new mime type in the cPanel: Code: docx => application/vnd.openxmlformats-officedocument.wordprocessingml.document But I still get the same error: The filetype you are attempting to upload is not allowed. I have contacted my hosting provider. I hope they can help me. Do you think there is any other configuration I can check to make it work? Kind regards!
[eluser]InsiteFX[/eluser]
You can try these also. Office Extension MIME Types: ./application/config/mimes.php Code: '.xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' Register the 2007 Office system file format MIME types on servers
[eluser]fran-quero[/eluser]
Thank you very much for your help, InsiteFx. I had already tested that docx mime you gave me, without success. My hosting provider say it may be a bad programmed script :S. We had strong words, and now they are stunding my problem. I'll be back with news when I have them! |
Welcome Guest, Not a member yet? Register Sign In |