Simple PHP web file sharing

Source: Internet
Author: User
It is very simple. it is used for file sharing on the web. 1. execute the * nix command to obtain the file in the local directory. 2. Generate the download link. 3. support the Chinese name, the name may contain spaces. 4. Save the source code as UTF-8 encoded. 5. assume that the sharing path is http: // xx_host/xx_dir, and the code name is index. put php in the xx_dir directory and generate the division

Simple, used for file sharing on the web
1. run the * nix command to obtain the local directory file.
2. generate a download link
3. Chinese names are supported. the names can contain spaces.
4. Save the source code as UTF-8 encoding.
5. assume that the sharing path is http: // xx_host/xx_dir, and the code is named index. php in the xx_dir Directory. all file download links except index. php are generated.

 

 private file boxprivate file box
 ";// var_dump ( $res );// var_dump ( $rc );// echo "
"; If (0 = $ rc) {// echo count ($ res )."
"; // Echo"
"; For ($ I = 0; $ I <count ($ res); $ I ++) {if ($ res [$ I]! = "Index. php") {// echo $ res [$ I]."
"; $ Encoded_url = urlencode ($ res [$ I]); $ encoded_url = str_replace (" + "," % 20 ", $ encoded_url ); $ encoded_filename = iconv ("GBK", "UTF-8", $ res [$ I]); $ encoded_temp_filename = explode (". ", $ encoded_filename); $ encoded_filename = $ encoded_temp_filename [0]; echo" $ encoded_filename "; echo"
"; Echo"
";}}} List_file_url () ;?>

 

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.