Welcome Guest, Not a member yet? Register   Sign In
Multiple file upload library
#31

[eluser]somenet[/eluser]
Dear friend,I need the thumbnail of the picture also how should i configure the code to get the thumbnail also.
#32

[eluser]Pent[/eluser]
[quote author="somenet" date="1345616711"]Dear friend,I need the thumbnail of the picture also how should i configure the code to get the thumbnail also.[/quote]

That's somewhat outside the scope of this topic I think, but take a look at the Image Manipulation class: http://ellislab.com/codeigniter/user-gui...e_lib.html
#33

[eluser]frankabel[/eluser]
Thanks for the library.

I have one question. In case I need identify what was the input field used by the user to upload a given file, what I must do? I mean, I have a form with three file input fields, and users can upload one of them, the my backend logic is different and tied to what input field the user select.

Thanks in advanced.
Frank
#34

[eluser]tim peterson[/eluser]
Hi Nihilistik,

I just wanted to say thanks for making this nice piece of code. I've incorporated into my CI app and it is working great. I've been looking for this for over a year so it is a HUGE help. Hopefully it will continue to help others too, thanks again!

best regards,
tim
#35

[eluser]Romyblack[/eluser]
[quote author="Pent" date="1345583684"]Just registered to say this was exactly what I was looking for, thank you very much. I do however run in a minor issue, if there are multiple entries in the "error" array (the files that did not get uploaded) their error messages are concatenated, like this (I'm echoing the file names and the error messages):

(filename1)

The file you are attempting to upload is larger than the permitted size.

(filename2)

The file you are attempting to upload is larger than the permitted size.

The file you are attempting to upload is larger than the permitted size.

So the first error message under filename2 is actually the error message of filename1. I found out this happens because for uploading all the files, one instance of the upload class is used, and the error messages are just added together (because one file can have multiple error messages). It can be fixed by clearing the error array after merging it in the $uploaded_info, like this:
[/quote]

Hi my friend, thanx for using my library and give me this information, im really sorry i did not answered you in the propper time, i was without pc for a wile. ill analize what you are trying to tell me and resolve this issue.
#36

[eluser]Romyblack[/eluser]
[quote author="frankabel" date="1349418311"]Thanks for the library.

I have one question. In case I need identify what was the input field used by the user to upload a given file, what I must do? I mean, I have a form with three file input fields, and users can upload one of them, the my backend logic is different and tied to what input field the user select.

Thanks in advanced.
Frank[/quote]

Hi that's a good question. ill see how we can fix this as soon as posible, im sorry i haven't answer for you early. but here i am, back to action.
#37

[eluser]Romyblack[/eluser]
[quote author="Pent" date="1345583684"]Just registered to say this was exactly what I was looking for, thank you very much. I do however run in a minor issue, if there are multiple entries in the "error" array (the files that did not get uploaded) their error messages are concatenated, like this (I'm echoing the file names and the error messages):

(filename1)

The file you are attempting to upload is larger than the permitted size.

(filename2)

The file you are attempting to upload is larger than the permitted size.

The file you are attempting to upload is larger than the permitted size.

So the first error message under filename2 is actually the error message of filename1. I found out this happens because for uploading all the files, one instance of the upload class is used, and the error messages are just added together (because one file can have multiple error messages). It can be fixed by clearing the error array after merging it in the $uploaded_info, like this:
Code:
#Here we do the upload process
   foreach($_FILES as $file => $value){
    if( $value['size'] > 0 ){
     if (!$this->do_upload($file)){
      $uploaded_info['error'][]  =  array_merge($this->data(),
          array('error_msg' => $this->display_errors()));
      $this->error_msg = array();
      
     }
     else{
      $uploaded_info['success'][] =  array_merge($this->data(),
          array('error_msg' => $this->display_errors()));
      $this->error_msg = array();
     }
    }
   }
[/quote]

Quote:Hi the problem was resolved please see the post and download the new version. thanks buddy.
Multiple file upload library
#38

[eluser]Romyblack[/eluser]
[quote author="frankabel" date="1349418311"]Thanks for the library.

I have one question. In case I need identify what was the input field used by the user to upload a given file, what I must do? I mean, I have a form with three file input fields, and users can upload one of them, the my backend logic is different and tied to what input field the user select.

Thanks in advanced.
Frank[/quote]

You made a very interesting question which helps me to improve this library, download the new version and confirm if you are ok with those changes.

Multiple file upload library:-)
#39

[eluser]frankabel[/eluser]
Thanks very much!

In my current project I already sort out this limitation using $_FILE data besise your library. Happy to know that in my upcomming projects I will not have to use $FILE var.

Thanks again for so great support.
Frank




Theme © iAndrew 2016 - Forum software by © MyBB