1. 程式人生 > >百度編輯器修改

百度編輯器修改

 在PHP檔案加下Uploader.class.php 中搜索下面方法

 

/**
* 獲取檔案完整路徑
* @return string
*/
private function getFilePath()
{
$fullname = $this->fullName;

if(empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['SCRIPT_FILENAME'])) { $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF']))); } if(empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['PATH_TRANSLATED'])) { $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF']))); }

$rootPath = $_SERVER['DOCUMENT_ROOT'];

if (substr($fullname, 0, 1) != '/') {
$fullname = '/' . $fullname;
}

return $rootPath . $fullname;
}

可以解決 圖片目錄建立失敗