• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload lib always returns false

#1
using the upload lib ci v3 with filetypes = gif|png|jpg, files of this type are always rejected because in is_allowed_filetype() it goes through all the checks but the last line returns false. should this not be return true?
bill
Reply

#2
Upload works fine for me in 3.0
Practical guide to IgnitedCMS - Book coming soon
Reply

#3
(08-02-2015, 05:08 AM)iamthwee Wrote: Upload works fine for me in 3.0

i'm using 

Code:
$cfg['file_name'] = '0_55be44d03fcdf.png';
$cfg['allowed_types'] = 'gif|jpg|jpeg|png';
$cfg['max_size'] = 0;

$cfg['max_width'] = 0;
$cfg['max_height'] = 0;
$this->upload->initialize($cfg);
$this->upload->do_upload('file');

i trace the is_allowed_filetype() in uploads.php and it goes the whole way from start to finish but the last line in the procedure is "return false" so upload doesnt proceed. if i change this to "return true" upload works fine.
Reply

#4
If it gets to the last line, that indicates that your mimes config isn't being loaded properly (or maybe you didn't update it from CI2, since CI3's /application/config/mimes.php returns the array, but CI2 just stores the array in the $mimes variable).
Reply

#5
(08-04-2015, 10:29 AM)mwhitney Wrote: If it gets to the last line, that indicates that your mimes config isn't being loaded properly (or maybe you didn't update it from CI2, since CI3's /application/config/mimes.php returns the array, but CI2 just stores the array in the $mimes variable).

yes, you are 100% correct, very sorry for that stupid oversight.
Many thanks, Bill
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.