[eluser]amalik[/eluser]
Hi,
Before I ask my question I just want to mansion that I am new to codeigniter so if I am asking any thing stupid I am really sorry. I got a page in my website where I am giving functionality to my user to upload an image and a zip file. At any given time only one of them works. You can upload the image or the zip file, cant upload both of them at the same time. I dont know what the problem is. The part of the form where I am trying to upload the files is given below for you to have a look at
Code:
<?php echo form_open_multipart('');?>
Upload Image <input type="file" name="userfile" size="20" class="form_input" />
Upload Zip File <input type="file" name="userfile1" size="20" class="form_input" />
and my controller where I am uploading the files are as follows
Code:
//uploading image file
if (!empty($_FILES['userfile']['name'])){
/* inatilizing image upload details */
$config['upload_path'] = './images/user/l_images/';
$config['allowed_types'] = 'jpg|jpeg|png';
$config['max_size'] = '10000';
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')){
/*display error*/
}
else{
$file_data = $this->upload->data();
}
}
//uploading the zip file
if (!empty($_FILES['userfile1']['name'])){
//print_r($_FILES['userfile1']);
$configure['upload_path'] = './zip_files/';
$configure['allowed_types'] = 'zip|rar';
$configure['max_size'] = '20000';
$this->load->library('upload', $configure);
if(!$this->upload->do_upload('userfile1')){
/*display error*/
}
else{
$zip_file_data = $this->upload->data();
}
}
I am really stuck and I will really appreciate if any body would like to help me.
Thanks in advance
amalik