![]() |
CI 2.1.2 - Unable to upload XML... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI 2.1.2 - Unable to upload XML... (/showthread.php?tid=55783) |
CI 2.1.2 - Unable to upload XML... - El Forum - 11-09-2012 [eluser]mrh[/eluser] Hello all, I'm on 2.1.2 and started to implement a file upload of an XML file type. This type is in the mimes file. The error received is always: The filetype you are attempting to upload is not allowed. even though I have set it as the allowed file type: Code: $config['upload_path'] = './uploads/'; In searching the forums here I see some older posts mentioning a bug in CI but it seems like 2.1.2 should have this corrected. If I set the file types to * then of course the upload works. Is this still a problem or is there some other issue going on? CI 2.1.2 - Unable to upload XML... - El Forum - 11-09-2012 [eluser]Narf[/eluser] The most recent ones of the mentioned topics would probably have comments saying that MIME-type detection depends on the server environment and it is not 100% guaranteed to be correct - that's just not possible to achieve. What you can do is to check what each of these methods say the type is and add it to config/mimes.php: Code: //Method 1: CI 2.1.2 - Unable to upload XML... - El Forum - 11-15-2012 [eluser]A_funs[/eluser] Both those php functions are not supported on my host, and I do not have shell access, I put the ogg file on the server and viewed it with my browser, shouldn't the http headers have the mime type assigned by the server? CI 2.1.2 - Unable to upload XML... - El Forum - 11-15-2012 [eluser]Narf[/eluser] You could then probably try to execute the file binary via PHP's exec(), shell_exec(), popen() - that's what CI does. Otherwise yes, headers sent by the server should reflect what the type is according to the host. |