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

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

fckeditor php上傳文件重命名的設(shè)置

熱門標(biāo)簽:長春銷售外呼系統(tǒng)業(yè)務(wù) 四平電話機(jī)器人哪家好 天津電銷卡外呼系統(tǒng)線路 興化400電話辦理多少錢 企業(yè)電話機(jī)器人辦理 株洲外呼營銷系統(tǒng)有哪些 靈聲智能電話機(jī)器人招聘 長春防封卡電銷卡套餐 智能電銷機(jī)器人真的好嗎
這里經(jīng)過摸索:找到了一個重命名的方法,大家看看好不好使。
首先:我希望上傳的文件根據(jù)日期來組織文件夾
請修改editor\editor\filemanager\connectors\php文件夾下的:config.php文件
找到如下的內(nèi)容:
// 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;
}
這樣上傳的文件就可以實(shí)現(xiàn)重命名了。
您可能感興趣的文章:
  • PHP自動重命名文件實(shí)現(xiàn)方法
  • php 隨機(jī)數(shù)的產(chǎn)生、頁面跳轉(zhuǎn)、件讀寫、文件重命名、switch語句
  • 6種php上傳圖片重命名的方法實(shí)例
  • 基于php上傳圖片重命名的6種解決方法的詳細(xì)介紹
  • PHP批量修改文件名稱的方法分析
  • php實(shí)現(xiàn)批量修改文件名稱的方法
  • PHP實(shí)現(xiàn)批量修改文件后綴名的方法
  • php實(shí)現(xiàn)文件編碼批量轉(zhuǎn)換
  • php中批量修改文件后綴名的函數(shù)代碼
  • php中批量替換文件名的實(shí)現(xiàn)代碼
  • PHP實(shí)現(xiàn)批量重命名某個文件夾下所有文件的方法

標(biāo)簽:貴港 黑龍江 青海 巴彥淖爾 新疆 運(yùn)城 漯河 石嘴山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《fckeditor php上傳文件重命名的設(shè)置》,本文關(guān)鍵詞  fckeditor,php,上傳,文件,重命名,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《fckeditor php上傳文件重命名的設(shè)置》相關(guān)的同類信息!
  • 本頁收集關(guān)于fckeditor php上傳文件重命名的設(shè)置的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 运城市| 苍梧县| 威信县| 瓦房店市| 萨迦县| 讷河市| 叙永县| 蓬莱市| 普定县| 关岭| 梓潼县| 和林格尔县| 郑州市| 靖安县| 五华县| 孝昌县| 莱阳市| 玛曲县| 东方市| 柳林县| 界首市| 双鸭山市| 鄯善县| 高清| 阳江市| 鹿泉市| 余庆县| 郯城县| 新化县| 万盛区| 湘潭县| 中卫市| 育儿| 深州市| 从江县| 淅川县| 信丰县| 金湖县| 宣恩县| 准格尔旗| 拉萨市|