howto upload two files with different allowed_types - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: howto upload two files with different allowed_types (/showthread.php?tid=12832) |
howto upload two files with different allowed_types - El Forum - 11-01-2008 [eluser]Mitja[/eluser] howto upload two files with different allowed_types. i need to upload two files, where first one must be an image (jpg, gif or png), the second file must be pdf. How to check all two uploads? If i use Code: $config['upload_path'] = './uploads/'; What to do now? $uploads = $this->upload->data() can not be used for boath files or i am wrong? Thx for help howto upload two files with different allowed_types - El Forum - 11-01-2008 [eluser]pistolPete[/eluser] Have a look at the documentation: Quote:$this->upload->do_upload() So all you have to do is call your two form fields differently, e.g. image and document, then process both form fields: Code: $image_data = array(); howto upload two files with different allowed_types - El Forum - 11-01-2008 [eluser]Colin Williams[/eluser] You also don't need to load the library twice. Just use the initialize() function again (only after the first upload happens, of course). |