![]() |
File Upload Class File type problem - 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: File Upload Class File type problem (/showthread.php?tid=27269) |
File Upload Class File type problem - El Forum - 02-05-2010 [eluser]RJ[/eluser] Hello, I'm trying to allow .log files to be uploaded but when specified it doesnt seem to matter, the same error appears "filetype you are attempting to upload is not allowed" Code: $config['allowed_types'] = 'txt|log'; any help is much appreciated File Upload Class File type problem - El Forum - 02-05-2010 [eluser]RJ[/eluser] I tried changing the file name before initilizing the upload class like this: Code: $tmp = substr($_FILES['userfile']['name'], 0,(strpos($_FILES['userfile']['name'],'.')+1)); But doesn't work, must be something in the temp name, any thoughts how I can fix this? If I change the files to .txt they upload fine, when they're .log it errors out every time. Thanks File Upload Class File type problem - El Forum - 02-08-2010 [eluser]RJ[/eluser] no one has any ideas? File Upload Class File type problem - El Forum - 02-08-2010 [eluser]danmontgomery[/eluser] In $this->upload->data(), file_type should be either 'text/plain' or 'text/x-log' (case sensitive), what is it? File Upload Class File type problem - El Forum - 02-08-2010 [eluser]RJ[/eluser] Quote:Array Application? Code: $config['allowed_types'] = 'txt|log'; A sample of the log file being uploaded is attached... i change from .log to .txt works great, but something isn't working right with .log; I had to zip the file, CI wont let me upload .log to the forum. File Upload Class File type problem - El Forum - 02-08-2010 [eluser]RJ[/eluser] Figured it out, for some reason the Code: $_FILES['userfile']['type'] a bug? |