Hi,
I'm trying to upload files that have a french accents in their name (like 'éà.txt'). I always have a server error.
Using $destname = iconv('UTF-8', 'CP1252', $name);
the file is now written on the server but I think that the insert in DB doesn't work.
How to fix this ??
Thanks,
Benjamin
Before database insert, you might need to set:
mysql_query("SET NAMES 'utf8'");
If you are using v1.5.2 or plus, this is default in mysql usage.
You might also check the database table and field collation, and make sure it is capable of storing utf8 content.
Hi,
That doesn't work … I'm using mysql v5.6.16.
For example, I have uploaded the file "aaaéèçààààà.txt". It works fine except that the file I see in the Explorer is named "aaaéèçà à à à à .txt".
The DB fields contains the correct path ("aaaéèçààààà.txt").
When I try to open it by clicking on the link, it doesn't find the file.
When I renamed it on the Explorer from "aaaéèçà à à à à .txt" to "aaaéèçààààà.txt", then it works.
In jggrid_dist_php and jggrid_dist_php4, I did this:
$destname = iconv('UTF-8', 'CP1252', $name);
if ( @move_uploaded_file($tmp_name, "$uploads_dir/$destname") )
{
$msg = "$uploads_dir/$name";
} …
the filename is written correctly in the Explorer but I got a "Server Error 500"
… please help !!
Thanks
I tested this case, after your patch:
$destname = iconv('UTF-8', 'CP1252', $name);
if ( @move_uploaded_file($tmp_name, "$uploads_dir/$destname") )
{
$msg = "$uploads_dir/$name";
}
It saves file with correct name in folder
Show correct file name in dialog
And save correct name path in database
For error 500, please check apache error log, OR response of update ajax call using firebug.