Chinese file names cannot be obtained when uploading files. solution:

Source: Internet
Author: User
". For some reason, the file name cannot be blank. The following is the code I wrote. myfile is a Chinese file name that cannot be obtained when a file is uploaded on the client.
". For some reason, the file name cannot be blank.

Below is the code I wrote, where myfile is the name of the input uploaded by the client.
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 file to be uploaded (that is, the file is uploaded through the http post Upload mechanism of PHP ). If the file is valid, move it to the file specified by destination.

I think this function lacks a $ destination parameter.
------ Solution --------------------
I have not carefully read the English language. in this case, I can start with coding.
Encodes a file name.

$ Dest_file = iconv ('utf-8', 'gbk', $ dest_file );

From UTF-8 to gbk or gbk to UTF-8, check which one 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.