Welcome Guest, Not a member yet? Register   Sign In
forms uploading image and text
#4

[eluser]ojcarga[/eluser]
I have worked uploading files just once but maybe this can help.

I used this to create my inputs (VIEW FILE)
Code:
$cfile=array('name'=>'fileup', 'id'=>'fileup', 'value'=>'File');
echo form_upload($cfile);

My Controller
Code:
function upload_psd() {
        if(!ini_get('safe_mode')) {
            set_time_limit(240);
            ini_set('max_execution_time',0);
            ini_set('memory_limit', '32M');
            ini_set('upload_max_filesize', '35M');
            ini_set('post_max_size', '35M');
            ini_set('max_input_time', 900);            
        }
                
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'zip|jpg';
$config['max_size'] = '35840';

        $this->load->library('upload', $config);

        if ( ! $this->upload->do_upload("fileup")){
            //$error = array('error' => $this->upload->display_errors());
            //echo '<p>NO SUBIO NI PICHA</p><br />';            
            return false;
        }else{
            //$data = array('upload_data' => $this->upload->data());
            //echo '<p>SI se subio muy bien</p><br />';
            return true;
        }
    }

I had to add the ini_set directives cause my server did not let me uploads anything, maybe you don't need them.


Messages In This Thread
forms uploading image and text - by El Forum - 05-09-2012, 08:01 AM
forms uploading image and text - by El Forum - 05-09-2012, 08:16 AM
forms uploading image and text - by El Forum - 05-09-2012, 08:22 AM
forms uploading image and text - by El Forum - 05-09-2012, 08:33 AM
forms uploading image and text - by El Forum - 05-12-2012, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB