I am using now Responsive file manager v9 as a plugin of tinymce, the version of tinymce is 4.7.4, PHP version is 5.5. The problem I was trying fix the uploaded arabic files' name issue, RFM doesn't upload files which their names is arabian with correct names.
The names of images I choose to test are "vvv" , "اختبار", "اختبار - Copy" all of them are 'jpg' after I upload the files those has an arabic names they give the result like this:
اختبار.jpg ===> ط§ط®طھط¨ط§ط±.jpg
اختبار - Copy.jpg ==> ط§ط®طھط¨ط§ط± - Copy.jpg
however, in config.php is the mb_internal_encoding function is UTF-8.
I tried use iconv by convert between utf-8 to cp1256 in UploadHandler.php line 1097 like this:
move_uploaded_file($uploaded_file, iconv("utf-8", "cp1256",$file_path));
instead of
move_uploaded_file($uploaded_file, $file_path);
and it allowed to upload the files with their arabian names but they appeared in RFM browser with ?????? and ????? - Copy and no thumbs images in browser, however the thumb folder had the images and the image اختبار.jpg didn't upload correctly and made it bad. only English files' names work fine.
I worked in all php files and I used base64_encode, and I tried change the the encoding in config.php but nothing work.
Does anyone have any idea to fix that ?
You don't want to mess with
UploadHandler.php
. All of the preprocessing of the upload happens inupload.php
, including massaging the filename in the functionfix_filename
inutils.php
. By the time it gets toUploadHandler
, the filename has already been modified soiconv
and friends won't work. Take a look at fix_filename and try manipulating the string there: