Welcome Guest, Not a member yet? Register   Sign In
File Upload. Everything I upload has mime octet-stream

I am using uploadify with codeigniter and when uploading, I keep getting "File type is not allowed". Upon error I am printing the files current type, and everything I upload is showing "oectet-stream".


<!DOCTYPE html>
&lt;html lang="en"&gt;

&lt;link href="&lt;?php echo base_url() ?&gt;assets/uploadify/uploadify.css" type="text/css" rel="stylesheet"&gt;


  $(document).ready(function() {
    'uploader'   : '&lt;?php echo base_url() ?&gt;assets/uploadify/uploadify.swf',
    'script'   : '&lt;?php echo site_url('upload/do_upload') ?&gt;',
    'cancelImg'  : '&lt;?php echo base_url() ?&gt;assets/uploadify/cancel.png',
    'auto'    : true,
    'fileDataName' : 'userfile',
    'onComplete' : function(a, b, c, d, e){
                    if (d !== '1') {alert(d);}
                    else { alert('Filename: ' + c.name + ' was uploaded');}


&lt;input id="file_upload" name="file_upload" type="file"&gt;




class Upload extends CI_Controller {

  public function __construct() {

  public function index() {
  public function do_upload() {
   $config['upload_path'] = '/tmp/';
   $config['max_size'] = '10000';
   $config['allowed_types'] = 'zip';
   $config['encrypt_name'] = true;
   $this->load->library('upload', $config);
   if(!$this->upload->do_upload()) {
    //echo $this->upload->display_errors();
    echo $_FILES['userfile']['type'];
   } else {
    echo 'Uploaded';


Any idea why it's doing this? I've tried allowing jpg, png, txt etc but it's still the same.

Theme © iAndrew 2016 - Forum software by © MyBB