php - Upload two files at once -


I'm attempting to upload two files at a time, despite providing the name of the field, the codinator errors on other fields Produces.

I have a limit of codeigniter, php or html, or am I just using the encocatus class?

  $ this-> Upload-> Do_upload ('video_file') $ this- & gt; Upload-> Do_upload ('image_file')  

Produces this image on the field:

  The file type you are trying to upload is not allowed < / Code> 

These are my two functions

  function upload_image () {$ thumb_size = 94; $ Config ['upload_path'] = './sets/uploads/images/'; $ Config ['allowed_types'] =' jpg | PNG | GIF '; $ Config ['max_size'] = '2048'; $ Config ['file_name'] = 'video_' rand (99 99 99, 99 99 99 99); $ This- & gt; Load-> Library ('upload', $ config); If (! $ This-> upload-> do_upload ('image_file')) {$ error = array ('error' => $ this-> upload-> display_errors ()); Return $ error; } Other {function upload_video () {$ config ['upload_path'] = './sets/uploads/videos/'; $ Config ['allowed_types'] = 'FLV'; $ Config ['max_size'] = '0'; $ Config ['file_name'] = 'video_' rand (99 99 99, 99 99 99 99); $ This- & gt; Load-> Library ('upload', $ config); If (! $ This- & gt; upload-> do_upload ('video_file')) {$ error = array ('error' => $ this-> upload-> display_errors ()); Return $ error; } Other { 

This class is loading as $ this -> gt; Load-> Library ('upload'); then $ this-> Upload-> Get started ($ config); Each time I upload a new file.


Comments