Unable to access Chinese file name when uploading file
Write a simple server-side file upload processing code, but the name of the English name upload Normal, Chinese name of the file name does not prompt the error, but the file name is empty after uploading, such as "document. doc", after uploading it becomes ". Doc". For unknown reasons, the file name should not be empty.
Here is the code I wrote, where MyFile is the name of the client uploading input.
PHP Code
------Solution--------------------
BOOL Move_uploaded_file (String $filename, String $destination)
This function checks and ensures that the file specified by filename is a valid upload file (that is, uploaded via PHP's HTTP POST upload mechanism). If the file is valid, move it to the file specified by destination.
I think this function is missing the reason that a $destination argument is passed in.
------Solution--------------------
I did not look at the English language is not a problem, so the basic can start from the code.
Make a code conversion to the file name
$dest _file=iconv (' UTF-8 ', ' GBK ', $dest _file);
Utf-8 to GBK or GBK to Utf-8 to see for yourself which is normal.