zoukankan      html  css  js  c++  java
  • wordpress上传含中文文件名出现乱码

    一、首先到FTP里面找到wp-admin/includes/file.php这个文件。

    二、查找wp_handle_upload在文件里面找到以下代码。

    function wp_handle_upload( &$file, $overrides = false, $time = null ) {
     //$new_file = $uploads['path'] . "/$filename"; 
    // 找到上面的代码,替换成下面的。 
    $new_file = $uploads['path'] . "/" . iconv("UTF-8","GB2312",$filename);
    //return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' ); 
    // 找到上面的代码,替换成下面的。  
    return apply_filters( 'wp_handle_upload', array( 'file' => $uploads['path'] . "/$filename", 'url' => $url, 'type' => $type ) , 'upload');
  • 相关阅读:
    动态规划题 HDU-1024
    高效位运算 __builtin_系列函数
    使用评价
    站立会议12-12
    场景调研
    站立会议12-10
    站立会议12-9
    站立会议12-8
    站立会议12-7
    站立会议12-6
  • 原文地址:https://www.cnblogs.com/phpfangzhan/p/8251323.html
Copyright © 2011-2022 走看看