Welcome Guest, Not a member yet? Register   Sign In
Problem with File Uploading Class..
#1

[eluser]Unknown[/eluser]
I'm having problems with the file uploading class. I implemented it and it works fine for normal file sizes, but when i try to upload a file of about 16 Mb, i get "You did not select a file to upload." and nothing on my POST variables, and $_FILES as an empty array. My PHP has the upload_max_filesize as 90M. Does anyone know what can be happening?

I'm trying to upload a 3gp file of 16 Mb, which i added to allowed_types, and added it to mimes.php as application/octet-stream.

This is my Controller Function:
Code:
function upload_file(){
        $config['upload_path'] = '/path/';
        $config['allowed_types'] = 'gif|jpg|png|doc|docx|pdf|xls|xlsx|ppt|mp4|3gp';
        $config['max_size']    = '0';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';
        $this->load->library('upload', $config);
        
        $this->load->model('clientes');
        
        if (!$this->upload->do_upload('myfile')){
            $data = array('error' => $this->upload->display_errors());
            
            $this->load->view('admin/header',$data);
            $this->load->view('admin/add_file', $data);
            $this->load->view('admin/footer');
        }    
        else
        {
            $upload = $this->upload->data();
            $insert = array(
                'cliente_id'    => $cliente_id,
                'nombre'        => $archivo,
                'archivo'        => $upload['file_name']
            );
            $this->clientes->add_file($insert);
            redirect('admin/success');
        }
        
    }

And this is my View:

Code:
<?php
if(!empty($error)){
echo $error;
}
?>
<?=form_open_multipart('admin/upload_file');?>
<table border="0">
<tr>
    <th>Nombre del Archivo:</th><td>&lt;?=form_input('nombre','','size="35"');?&gt;</td>
</tr>
<tr>
    <th>File:</th><td>
        &lt;?=form_upload('myfile','','id="file"');?&gt;
    </td>
</tr>
<tr>
    <td colspan="2">
        &lt;?=form_hidden('cliente_id',$cliente_id);?&gt;
        &lt;?=form_submit('submit','Upload')?&gt;
    </td>
</tr>
</table>
&lt;?=form_close()?&gt;

Thanks for the help




Theme © iAndrew 2016 - Forum software by © MyBB