• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image upload how to force lowercase the file extension??

#1
[eluser]123wesweat[/eluser]
Hi,

I have a working image upload, but i notice that image_3.jpg and image_3.JPG are saved as two different files. How can i prevent this??

#2
[eluser]kirkaracha[/eluser]
PHP's strtolower function.

#3
[eluser]123wesweat[/eluser]
yep, i know that one but i can't get it to work.

tried
Code:
$config['file_name'] = strtolower('avatar_'.$user_id);

and

strtolower($upload_data['file_name']);

does something like this exist
Code:
$config["extension_tolower"] = TRUE;

#4
[eluser]123wesweat[/eluser]
ok found a solution:
Code:
$_FILES[ $field_name ]['name'] = strtolower($_FILES[ $field_name ]['name']);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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