如何修改fckeditor的图片上传目录
2009-07-02 10:10
351 查看
fck默认的图片上传路径是在fckeditor-java-core.jar的net.fckeditor.handles包下的default.properties中定义的,内如如下:
# base directory for the user files relative to the context root
connector.userFilesPath = /userfiles
fck是在net.fckeditor.handlers包中的PropertiesLoader类中声明了一个static的properties来一次性读入所有的配置的
这是个静态的属性,而且提供了修改的权限
/**
* Setter for a property. If the property already exists, the value will be
* overridden.<br />
* <em>Hint</em>: This method is intended as an alternative way to set
* properties programmatically instead of using the
* <code>fckeditor.properties</code>. It should never used inside
* FCKeditor.Java!!!
*
* @param key
* The property key.
* @param value
* The property value.
* @see Properties#setProperty(String, String)
*/
public static void setProperty(final String key, final String value) {
properties.setProperty(key, value);
}
所以只需要在fck加载之前修改他既可,比如可以修改fck的例子如下:
String userCode="xxx";//此处可以获取登录用户code等动态代码
PropertiesLoader.setProperty("connector.userFilesPath","/aaaa"+userCode);
fckEditor.setValue("This is some <strong>sample text</strong>. You are using <a href=/"http://www.fckeditor.net/">FCKeditor</a>.");
out.println(fckEditor);
这样会生成aaaxxx文件夹
# base directory for the user files relative to the context root
connector.userFilesPath = /userfiles
fck是在net.fckeditor.handlers包中的PropertiesLoader类中声明了一个static的properties来一次性读入所有的配置的
这是个静态的属性,而且提供了修改的权限
/**
* Setter for a property. If the property already exists, the value will be
* overridden.<br />
* <em>Hint</em>: This method is intended as an alternative way to set
* properties programmatically instead of using the
* <code>fckeditor.properties</code>. It should never used inside
* FCKeditor.Java!!!
*
* @param key
* The property key.
* @param value
* The property value.
* @see Properties#setProperty(String, String)
*/
public static void setProperty(final String key, final String value) {
properties.setProperty(key, value);
}
所以只需要在fck加载之前修改他既可,比如可以修改fck的例子如下:
String userCode="xxx";//此处可以获取登录用户code等动态代码
PropertiesLoader.setProperty("connector.userFilesPath","/aaaa"+userCode);
fckEditor.setValue("This is some <strong>sample text</strong>. You are using <a href=/"http://www.fckeditor.net/">FCKeditor</a>.");
out.println(fckEditor);
这样会生成aaaxxx文件夹
相关文章推荐
- Wordpress最新3.5版本如何修改图片默认上传目录路径
- fckeditor 2.6如何修改图片上传路径和格式
- Wordpress最新3.5版本如何修改图片默认上传目录路径
- 最新Wordpress 3.5版本如何修改图片默认上传目录路径
- 修改fckeditor使上传文件按用户id分目录存放,其上传图片加水印及缩略图
- FCKEditor上传图片后,如何进行重命名
- 【UEditor】php版的UEditor 1.3.x图片上传目录的设置,与上传插件的修改
- linux服务器 修改 图片上传upload目录 权限
- FCKeditor是使用非常广泛的HTML编辑器,本文从 ASP.NET 的使用场景对 FCKeditor 与 FCKeditor.NET 的配置、功能扩展(如自定义文件上传子目录、自定义文件名、上传图片的后期处理等)、以及安全性进行初步的阐述。
- 关于如何去除fckeditor中图片上传对话框中的链接和高级两个选项
- ASP中用ASPJPEG如何给FCKEditor上传的图片加水印
- 关于如何去除fckeditor中图片上传对话框中的链接和高级两个选项(转帖)
- 如何通过Fckeditor把图片上传到独立图片服务器
- FCKEditor 修改上传图片路径(按日期)
- 如何用fckeditor编辑器上传图片、flash、视频到moss的图片库中
- ecshop编辑器FCKeditor修改成KindEditor编辑批量上传图片
- ASP中用ASPJPEG如何给FCKEditor上传的图片加水印
- asp.net让FCKEditor上传图片到动态指定的目录
- ueditor上传图片时目录创建失败的问题解决方法,不用那么麻烦,其实修改php/config.json这个配置文件里面的路径就行!!
- ueidtor上传图片目录修改记录。