Attachment file name error?

Please report bugs here!

Moderator: Thorsten

Post Reply
seri
Posts: 22
Joined: Wed May 11, 2016 3:43 am

Attachment file name error?

Post by seri » Thu Jul 14, 2016 1:51 am

Hi
It becomes the error when I attach the file of the multi byte name.
The error message says
"The attached file must be smaller than 1.95Bytes."

Single byte name is OK,and "Maximum size for attachments in Bytes" at configuration is up to 2048000.

Thorsten
Posts: 14752
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment file name error?

Post by Thorsten » Thu Jul 14, 2016 8:40 am

Hi,

which version are you using? I think we had a fix for that in 2.9.2

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

seri
Posts: 22
Joined: Wed May 11, 2016 3:43 am

Re: Attachment file name error?

Post by seri » Thu Jul 14, 2016 9:17 am

Upgraded 2.9.2.

I think that this error did not happen at the time of version 2.9.0.

Thorsten
Posts: 14752
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment file name error?

Post by Thorsten » Thu Jul 14, 2016 9:19 am

Hi,

can you send me the file via e-mail for testing?

Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Thorsten
Posts: 14752
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment file name error?

Post by Thorsten » Thu Jul 14, 2016 7:10 pm

Hi,

thanks for the PDF file. It worked on my machine...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

seri
Posts: 22
Joined: Wed May 11, 2016 3:43 am

Re: Attachment file name error?

Post by seri » Fri Jul 15, 2016 6:41 am

I found that my other server with IIS on windows is OK.

On Apache2.4 on Linux,I got this error.
Do you have any ideas whether to change httpd.conf or php.ini?

And It works fine at Apache with filename start with single byte word and middle of it contains multi byte word.
e.g. "1あ.pdf"

seri
Posts: 22
Joined: Wed May 11, 2016 3:43 am

Re: Attachment file name error?

Post by seri » Tue Jul 26, 2016 7:46 am

Hi,
I understood that this error was result of the basename function.

http://php.net/manual/en/function.basename.php
Note:
basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function.

At inc/PMF/Init.php
I was recovered when I inserted this one sentence.
setlocale(LC_ALL, 'ja_JP.UTF-8');

Thorsten
Posts: 14752
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Attachment file name error?

Post by Thorsten » Tue Jul 26, 2016 6:47 pm

Hi,

could you please try

Code: Select all

setlocale(LC_ALL, '');
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

seri
Posts: 22
Joined: Wed May 11, 2016 3:43 am

Re: Attachment file name error?

Post by seri » Wed Jul 27, 2016 12:28 am

Hi,
It became the error in the same way as a beginning.
Thorsten wrote:Hi,

could you please try

Code: Select all

setlocale(LC_ALL, '');
bye
Thorsten

Post Reply