婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > fckeditor php上傳文件重命名的設置

fckeditor php上傳文件重命名的設置

熱門標簽:長春銷售外呼系統業務 四平電話機器人哪家好 天津電銷卡外呼系統線路 興化400電話辦理多少錢 企業電話機器人辦理 株洲外呼營銷系統有哪些 靈聲智能電話機器人招聘 長春防封卡電銷卡套餐 智能電銷機器人真的好嗎
這里經過摸索:找到了一個重命名的方法,大家看看好不好使。
首先:我希望上傳的文件根據日期來組織文件夾
請修改editor\editor\filemanager\connectors\php文件夾下的:config.php文件
找到如下的內容:
// Path to user files relative to the document root.
$Config['UserFilesPath'] =
修改為:
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/uploadfiles/'.date("Ym")."/" ;
這樣上傳的文件就按照日期存放了。
其次:重命名
請修改該文件夾下的io.php文件
找到:
// Do a cleanup of the file name to avoid possible problems
function SanitizeFileName( $sNewFileName )
{
global $Config ;
$sNewFileName = stripslashes( $sNewFileName ) ;
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
 $sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFileName ) ;
// Remove \ / | : ? * " >
$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"||>/', '_', $sNewFileName );
return $sNewFileName ;
}
修改為:
// Do a cleanup of the file name to avoid possible problems
function SanitizeFileName( $sNewFileName )
{
global $Config ;
$sNewFileName = stripslashes( $sNewFileName ) ;
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
 $sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFileName ) ;
$sExtension = substr( $sNewFileName, ( strrpos($sNewFileName, '.') + 1 ) ) ;
$sNewFileName = my_setfilename().'.'.$sExtension;
return $sNewFileName ;
}
function my_setfilename(){
$gettime = explode(' ',microtime());
$string = 'abcdefghijklmnopgrstuvwxyz0123456789';
$rand = '';
for ($x=0;$x12;$x++)
 $rand .= substr($string,mt_rand(0,strlen($string)-1),1);
return date("ymdHis").substr($gettime[0],2,6).$rand;
}
這樣上傳的文件就可以實現重命名了。
您可能感興趣的文章:
  • PHP自動重命名文件實現方法
  • php 隨機數的產生、頁面跳轉、件讀寫、文件重命名、switch語句
  • 6種php上傳圖片重命名的方法實例
  • 基于php上傳圖片重命名的6種解決方法的詳細介紹
  • PHP批量修改文件名稱的方法分析
  • php實現批量修改文件名稱的方法
  • PHP實現批量修改文件后綴名的方法
  • php實現文件編碼批量轉換
  • php中批量修改文件后綴名的函數代碼
  • php中批量替換文件名的實現代碼
  • PHP實現批量重命名某個文件夾下所有文件的方法

標簽:貴港 黑龍江 青海 巴彥淖爾 新疆 運城 漯河 石嘴山

巨人網絡通訊聲明:本文標題《fckeditor php上傳文件重命名的設置》,本文關鍵詞  fckeditor,php,上傳,文件,重命名,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《fckeditor php上傳文件重命名的設置》相關的同類信息!
  • 本頁收集關于fckeditor php上傳文件重命名的設置的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 武汉市| 明星| 长沙市| 长丰县| 元朗区| 河北省| 赤城县| 库伦旗| 冀州市| 庆阳市| 盘锦市| 德令哈市| 睢宁县| 延川县| 修文县| 天津市| 会宁县| 新安县| 迁安市| 嘉峪关市| 格尔木市| 遵义市| 通化市| 宣城市| 临沧市| 霍城县| 太谷县| 古浪县| 邯郸县| 通辽市| 登封市| 温宿县| 万盛区| 宜黄县| 东丰县| 临猗县| 苏尼特右旗| 莒南县| 扎囊县| 宁远县| 肥东县|