Welcome Guest, Not a member yet? Register   Sign In
Max file upload size
#1

[eluser]mvdg27[/eluser]
Hi guys,

I'm running into some problems with uploading large file through the upload class. If I select a small jpeg image everything works fine. But as soon as my file goes above 8MB it fails and returns "You did not select a file to upload."

Ok. So I checked my phpinfo and indeed te max file upload size is set to 8mb. However in the controller that contains my upload function, I've inserted an ini_set

Code:
ini_set('upload_max_filesize', '32M');
ini_set('max_execution_time', '600');

class Files extends Controller {

    // ..

    function upload_file() {
    
        // ..

        if(!$upload_erors = $this->general_model->upload_file($target_folder, $file, $allowed)) {                    
            $o['success'] = true;
            $o['message'] = $this->lang->line('file_uploaded');
        }
        else {
            $o['message'] = $upload_errors;
            $o['success'] = false;    
        }

        print json_encode($o);
    }

    // ..
}

And the code in my model is quite straightforward:

Code:
function upload_file($target_folder, $file, $allowed) {
                        
    $config['upload_path'] = $target_folder;
    $config['allowed_types'] = $allowed;
    $this->load->library('upload', $config);
    $this->upload->initialize($config);
        
    $this->upload->do_upload($file);
        
    return $this->upload->display_errors();

}

Any ideas on how to make my upload work with larger files as well?

Thanks in advance!


Messages In This Thread
Max file upload size - by El Forum - 07-23-2009, 03:31 AM
Max file upload size - by El Forum - 07-23-2009, 05:12 AM
Max file upload size - by El Forum - 07-23-2009, 05:35 AM
Max file upload size - by El Forum - 07-23-2009, 06:39 AM
Max file upload size - by El Forum - 07-23-2009, 06:42 AM
Max file upload size - by El Forum - 07-23-2009, 07:57 AM
Max file upload size - by El Forum - 07-23-2009, 11:26 AM
Max file upload size - by El Forum - 07-24-2009, 05:22 AM
Max file upload size - by El Forum - 07-24-2009, 05:23 AM
Max file upload size - by El Forum - 07-30-2009, 07:49 AM
Max file upload size - by El Forum - 07-30-2009, 08:18 AM
Max file upload size - by El Forum - 08-27-2009, 12:16 AM
Max file upload size - by El Forum - 07-31-2012, 01:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB