fckeditor php 파일 이름 바 꾸 기 설정 업로드

여기 서 모색 을 통 해 이름 을 바 꾸 는 방법 을 찾 았 습 니 다.여러분,괜 찮 은 지 보 세 요.우선:제 가 업로드 하고 싶 은 파일 은 날짜 에 따라 폴 더 를 구성 합 니 다.editor\editor\filemanager\\connectors\\php 폴 더 아래 의:config.php 파일 은 다음 과 같은 내용 을 찾 습 니 다.//Path to user files relative to the document root.$Config['UserFiles Path']=수정:/Path to user files relative to the document root.$Config['UserFiles Path']='/uploadfiles/'.date("Ym")."/" ; 이렇게 올 린 파일 은 날짜 에 따라 저장 되 었 다.다음:이름 을 바 꾸 려 면 이 폴 더 에 있 는 io.php 파일 을 수정 하 십시오://Do a cleanup of the file name to avoice 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;$x<12;$x++)  $rand .= substr($string,mt_rand(0,strlen($string)-1),1); return date("ymdHis").substr($gettime[0],2,6).$rand; } 이렇게 업로드 한 파일 은 이름 을 바 꿀 수 있 습 니 다.

좋은 웹페이지 즐겨찾기