![]() |
Uploading files to multiple folders..almost there. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Uploading files to multiple folders..almost there. (/showthread.php?tid=17756) |
Uploading files to multiple folders..almost there. - El Forum - 04-14-2009 [eluser]generalsalt[/eluser] I have two fields. One is 'userfile' the other is 'project_photos'. I am trying to upload the files uploaded from 'project_photos' to the projects folder and the 'userfile' to the 'thumbails' folder. I have gone over this code again and again, it seems like it should work. It doesn't of course. Code: function do_upload() Also, curious about the 'do_upload' function. What calls this function? Is it automatically called when A POST is detected? Uploading files to multiple folders..almost there. - El Forum - 04-14-2009 [eluser]Colin Williams[/eluser] Quote:What calls this function? You call that function. It looks like you don't have a 'userfile' named file upload field, and/or you have not told CI to use a different field. In your foreach, you should set the file field name along with the upload_path Uploading files to multiple folders..almost there. - El Forum - 04-15-2009 [eluser]generalsalt[/eluser] I have two form fields one called name="project_photos[]" and by default CI calls the other one 'userfile'. Can you expand on that a little? What does setting the 'file field' do, and how do you set it? Uploading files to multiple folders..almost there. - El Forum - 04-15-2009 [eluser]generalsalt[/eluser] [quote author="Colin Williams" date="1239791067"] You call that function. [/quote] What I mean is I see in the User Manual it says to do this to set your own field name: Code: $field_name = "some_field_name"; I'm not calling do_upload like that, only setting it as the form action. How do you pass arguments in if you call the 'do_upload' from a form action? Uploading files to multiple folders..almost there. - El Forum - 04-15-2009 [eluser]generalsalt[/eluser] Really need some help here.. Right now I have : Code: <form action="http://url.com/upload/do_upload" method="post" enctype="multipart/form-data"> How do I specify different fields calling he do_upload functin like this? Uploading files to multiple folders..almost there. - El Forum - 04-15-2009 [eluser]generalsalt[/eluser] Code: if($field == 'project_photos') This worked..yaaah..me. |