标签:
<textarea id="content" name="content">
{$info[‘content‘]}
</textarea>
<script type="text/javascript" src="/Public/ckeditor/ckeditor.js"></script>
<script>
CKEDITOR.replace( ‘content‘ ,{
filebrowserBrowseUrl:‘__PUBLIC__/ckfinder/ckfinder.html‘,
filebrowserImageBrowseUrl:‘__PUBLIC__/ckfinder/ckfinder.html?type=Images‘,
filebrowserFlashBrowseUrl: ‘__PUBLIC__/ckfinder/ckfinder.html?type=Flash‘,
filebrowserUploadUrl: ‘__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files‘,
filebrowserImageUploadUrl: ‘__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images‘,
filebrowserFlashUploadUrl: ‘__PUBLIC__/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash‘}
);
</script>
原理: 在上传完成时,将文件保存的名字重命名一下,当然,需要放在它本身的文件名验证之后
解决方案 fileupload.php中 找到文件名检测的最后面,例如
$overwriteOnUpload = $config->get(‘overwriteOnUpload‘);
if (!$overwriteOnUpload && $uploadedFile->autorename()) {
$warningErrorCode = Error::UPLOADED_FILE_RENAMED;
}
$fileName = $uploadedFile->getFilename();
在这段代码后面添加文件重命名,
$fileName = date(‘YmdHis‘).‘.‘.$uploadedFile->getExtension();
标签:
原文地址:http://www.cnblogs.com/mengxingxinqing/p/5620917.html