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 () ;?>