======php upload function ======

Source: Internet
Author: User
======php Download Function ======

Header (' CONTENT-TYPE:VIDEO/MPEG4 ');//type of output
Header (' content-disposition:attachment; filename= ' filename. mp4 "'); Download the displayed name
ReadFile (' filename. mp4 ');
?>

This is the download code I'm using.
However, when the file name is in Chinese, the download box and the downloaded file display the name is garbled.
is PHP in this download feature does not recognize Chinese?

How should this PHP download function be modified to properly download files with Chinese name? PHP Header Download


------Solution--------------------
Whether the garbled display is related to the default character set of the user's operating system
------Solution--------------------
Header ("content-type:text/html; Charset=utf-8 ");

------Solution--------------------
First read the file name to Url_encode transcoding and then execute the download program
------Solution--------------------
Two upstairs is to mess up the ha haha ~
------Solution--------------------
You look at your PHP file format, file format and code format consistent or it will be garbled

Your php file is UTF8 words you add this bureau header ("content-type:text/html; Charset=utf-8 "); top
------Solution--------------------
You can transfer your download file name Iconv () to the next test

  • 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.