multiple uploading files |
[eluser]rakish[/eluser]
Hi..any idea about multiple uploading files? I'm having a hard time for this.. answers will be highly appreciate, thank you soo much! in advance..
[eluser]rakish[/eluser]
Here is my code and there's still a problem..I need help? function do_upload() { $files = array('userfile_0'=>array('upload_path'=>'./media/uploads/','allowed_types'=>'gif|jpg|png','max_size'=>100), 'userfile_1'=>array('upload_path'=>'./media/uploads/about','allowed_types'=>'gif|jpg|png','max_size'=>100)); $this->load->library('upload'); $res['id'] = 1; $res['missionimage'] = $_FILES['userfile_0']['name']; $res['staffimage'] = $_FILES['userfile_1']['name']; foreach($files as $field=>$settings) { $this->upload->initialize($settings); if ( !$this->upload->do_upload($field)) { redirect('backend/about/index/tryagain'); } else { $data = array('upload_data' => $this->upload->data()); $this->mabout_content->uploadPhoto($res); redirect('backend/about/index/imagesaved'); } } }
[eluser]CI_avatar[/eluser]
please check this ajaxupload it works for me. i am using it in my codeigniter. http://valums.com/ajax-upload/ note: ajaxupload requires jquery
[eluser]Zeeshan Rasool[/eluser]
[quote author="rakish" date="1258458726"]Hi..any idea about multiple uploading files? I'm having a hard time for this.. answers will be highly appreciate, thank you soo much! in advance..[/quote] Either you can do it with repeating your one piece of code for all files to upload or use a loop to upload all files.
[eluser]Unknown[/eluser]
I'm not sure how good you are with Flash AS3, but it has a FileReferenceList class that allows you to select multiple files and then upload them in a queue to a controller method for processing. I use this all the time and it works really well, especially when you need to filter file types or check the size of something before you post it to the server. Because its routed through Flash, you also get upload progress data and can display the percent uploaded or create a progress bar.
[eluser]Unknown[/eluser]
I made this function, all you need to do is run it, and make some small changes in CI files. Code: /* Code: $this->file_name = ""; Code: $filename .= '.'.$ext; Code: if ($this->file_name != '') Hope it'll help, and sorry for my English, not used to speak much.
[eluser]alvk4r[/eluser]
May be the solution it's http://ellislab.com/forums/viewthread/156352/ |
Welcome Guest, Not a member yet? Register Sign In |