Part of the EllisLab Network
   
3 of 3
3
Latavish’s Multiple Image Upload with Thumbnail Generation
Posted: 19 November 2009 10:43 AM   [ Ignore ]   [ # 21 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  03-27-2008

i totally forget about this post. I have a much better version of this script. i’ll post tonight when I get off the 9 to 5.

 Signature 

———————————
Programming Is an Art

Profile
 
 
Posted: 22 November 2009 10:48 AM   [ Ignore ]   [ # 22 ]  
Research Assistant
RankRankRank
Total Posts:  320
Joined  11-06-2008
Latavish - 19 November 2009 03:43 PM

i totally forget about this post. I have a much better version of this script. i’ll post tonight when I get off the 9 to 5.

Hello mate, how is it going with an update?:)

thanks!

Profile
 
 
Posted: 23 November 2009 12:41 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  2
Joined  11-23-2009

I’m also really anxious to see your latest version of your script. I have been working on integrating a cool flash-based solution into a non-CI site.  I would love to get that same type of interface working with CI.  It sounds like that is what you have working but I’m not sure.  I would also love to see a sample of how it looks/works.  Do you have anything up that we could look at?  Anyway thanks for your great contribution to the community

Profile
 
 
Posted: 18 January 2010 05:14 AM   [ Ignore ]   [ # 24 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  342
Joined  12-16-2009

hi to all,

im having an error with my upload script in CI. the image don’t show off in the database and in the folder where it should be put in.

here’s my script:
CONTROLLER:

$config['upload_path''./reports/module/';
                
$config['allowed_types''gif|jpg|png';
                
$config['max_size']    '100';
                
$config['max_width']  '1024';
                
$config['max_height']  '768';
                
$this->load->library('upload'$config);
                
                
$file_data $this->upload->data();
                
$file_name $file_data['file_name'];
                
                    
$fields = array(
                
"module_id",
                            
"module_name",
                
"slug",
                
"icon"=>$file_name,            
                            
"report_file_name",
                            
"sql_select",
                            
"sql_filter",
                            
"sql_order"
                            
);

                    foreach (
$fields as $field)
                    
{
                        
if (isset($_POST[$field])) $dt[$field] $this->input->post($field);
                    
}
                
                    $item 
$this->input->post("item");
                    
$rows $this->input->post("row0");
                            
                    
$data['item'$this->Reports->save($dt,$item,$rows); 

MODEL:

function save($data,$item,$details{
        
if ($item == ''{
            $data[
'link'"reports/view";
            
$this->db->trans_start();
            
$this->db->insert('sec_reports'$data);
            
$item $this->db->insert_id();
            
$this->save_detail($item,$details);                
            
$this->db->trans_complete();
        
}
        
else {
            $this
->db->trans_start();
            
$this->db->where('module_id'$item);
            
$this->db->update('sec_reports'$data);
            
$this->save_detail($item,$details);                
            
$this->db->trans_complete();
        
}
        
return $item;
    

help me please..

regards,
kahtrina

 Signature 

“Anything executable is testable”- debug

Profile
 
 
Posted: 04 August 2010 12:49 AM   [ Ignore ]   [ # 25 ]  
Summer Student
Avatar
Total Posts:  2
Joined  05-21-2010

very thankyou for santiag0 and vik407 smile

 Signature 

littleflow3r^^

Profile
 
 
Posted: 22 September 2010 08:55 AM   [ Ignore ]   [ # 26 ]  
Summer Student
Total Posts:  18
Joined  03-05-2008

@santiag0 ... nice work, it’s simple and works nearly flawlessly!

but you have to call

$this->upload->initialize($config);

before each
       
$this->upload->do_upload();

to avoid problems caused by internal states of the upload class.

@vik407

the double extension problem is avoided if you add the code as mentioned above.

Profile
 
 
Posted: 10 January 2011 03:35 PM   [ Ignore ]   [ # 27 ]  
Summer Student
Total Posts:  3
Joined  01-10-2011

Hi I have a form with 2 text boxes and multiple files. The problem is that when I have 2 attachments The method that saves information from the text boxes running 2 times
(for each file).I know that the error comes from the cycle, but do not know how to fix it

Example:

FORM

title = TEST
desc = descript for test

file1 = test.doc
file2 = test2.doc

DB
id 1 TEST descript for test
id 2 TEST descript for test

Please help

Comments are the Bulgarian

foreach($_FILES as $key => $value)
           
{

                         
// Проверявам дали полетата са празни
                    
if(!empty($value['name']))
                    
{
                    $this
->upload->initialize($config);

                    
// АКО ИМА ГРЕШКИ
                
if (!$this->upload->do_upload($key))
                
{
                    $data[
'error'][$j] =  $this->upload->display_errors();
                    
$j++;
                
}
                
else
                
{
                    $this
->load->model('Process_image');
                    
                   
// КАЧЕНИТЕ ФАЙЛОВЕ
                    
$file $this->upload->data();
               
                
$file = array('upload_data' => $this->upload->data());
               
// Проверявам да ли файла е изображение
                
$name $file['upload_data']['is_image'];
        
                if((
$name)){
                    
// Ако е правя thumbnail
                 
$this->Process_image->process_pic();

                
}else{
                    
//Aко не е го записвам в базата
                    //$this->Art_model->add_f();
                    //$this->Art_model->add();
                   
                
}

                }
                }
                $this
->Art_model->add();
                
              
        
Profile
 
 
Posted: 14 July 2011 05:40 AM   [ Ignore ]   [ # 28 ]  
Summer Student
Total Posts:  5
Joined  05-16-2011
Latavish - 19 November 2009 03:43 PM

i totally forget about this post. I have a much better version of this script. i’ll post tonight when I get off the 9 to 5.

did you ever post the update?

Max

Profile
 
 
Posted: 19 January 2012 01:54 PM   [ Ignore ]   [ # 29 ]  
Summer Student
Total Posts:  30
Joined  02-07-2011

Hi guys, im new to this and this thread helps me a lot..thank you!! smile

Profile
 
 
   
3 of 3
3