CTOlet / yii2-attachments

Yii2 extension for uploading and attaching the files to the models
66 stars 57 forks source link

Bug \nemmo\attachments\Module Line140 pathinfo renturn '' when filename is chinese. #14

Open hexl opened 9 years ago

hexl commented 9 years ago

$file->name = pathinfo($filePath, PATHINFO_FILENAME);

-> $filePath='D:/test/中文文件名测试.jpg'

-> the $file->name is empty.

CTOlet commented 9 years ago

Maybe you should use setlocale function? http://php.net/manual/ru/function.setlocale.php

hexl commented 9 years ago

qq 20150510002119

change the code like this?

CTOlet commented 9 years ago

How does it work? Why do you add '_' in chinese?

hexl commented 9 years ago

because if without _ the chinese file name will be empty

In Module.php remove is ok

CTOlet commented 9 years ago

I understood that it will be empty. I dont understant why? P.S Your pull request is not correct. You removes the first character every time. But what about the filename, for example, 1.jpg? It will be .jpg, so I think that you are not right.

hexl commented 9 years ago

I have another change you can see it in the picture. I just forgot to commit it. change fiel FileController

CTOlet commented 9 years ago

I could not catch that error, closing issue

CTOlet commented 7 years ago

Bug http://stackoverflow.com/questions/4451664/make-php-pathinfo-return-the-correct-filename-if-the-filename-is-utf-8