I have set up codeigniter to upload small files < 2MB and that works fine. But I am having trouble uploading large files 20MB >
function stage1()
{
ini_set('upload_max_filesize', '200M');
ini_set('post_max_size', '200M');
ini_set('max_input_time', 3000);
ini_set('max_execution_time', 3000);
$config['upload_path'] = './temp/';
$config['allowed_types'] = 'zip';
$this->load->library('upload', $config);
$this->upload->initialize($config);
if(!$this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
//do stuff
}
}
I am not sure what is wrong with the above code. I overrode the php.ini to accept larger files and to take more time executing the script but it still returns the same error:
You did not select a file to upload.
Again, this works with small files but not large ones.
EDIT: Turns out my server provider has limited file uploads so there is no solution besides to FTP the file in.
Best Answer
Below code use in your php file.
set below code in .htaccess file
Edit my answer after you comment
Update answer
Set config parameter in your stage1 function.
After then try it.