Cannot get Chinese file name resolution when uploading files

Source: Internet
Author: User
Tags http post
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.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.