php ckeditor Upload image file name scrambling solution

  • 2020-11-25 07:12:29
  • OfStack

Open editor/filemanager/connectors/php under commands.php and find the FileUpload function in


$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ; 
$sExtension = strtolower( $sExtension ) ;


After adding


$sFileName = rand(0,100).".".$sExtension;


Here the rand function can change the renaming rules as needed.
Another solution to upload image file name confusion is to use iconv function to encode and convert the file name, but there is still a problem with the same name, so it is better to rename the image file name for Fckeditor

Related articles: