Uploading a .php file via do_upload - 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: Uploading a .php file via do_upload (/showthread.php?tid=31766) |
Uploading a .php file via do_upload - El Forum - 06-30-2010 [eluser]popovich[/eluser] Hi, I am trying to upload a .php file using the upload class. Here is a part of the code Code: if( isset($_FILES['layoutfile']) ){ Nothing before this piece of code or after it does anything to $_FILES array. The screen I get looks like this: Code: application/octet-stream Apparently, the upload class cannot upload the file because of its mime-type? The form in the view file has Code: enctype="multipart/form-data" Where is the trouble?... Uploading a .php file via do_upload - El Forum - 07-01-2010 [eluser]popovich[/eluser] No ideas? Uploading a .php file via do_upload - El Forum - 07-01-2010 [eluser]popovich[/eluser] I got it. system/application/config/mimes.php change the line Code: 'php' => 'application/x-httpd-php', to Code: 'php' => array('application/x-httpd-php','application/octet-stream'), Uploading a .php file via do_upload - El Forum - 07-01-2010 [eluser]bryantAXS[/eluser] thanks for posting your solution, i feel like i might need this at some point |