CKFinder。重命名上传的文件 [英] CKFinder. Rename uploaded files

查看:319
本文介绍了CKFinder。重命名上传的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CKFinder的ASP.NET版本。我需要所有上传的文件重命名为名称类似:file1.jpg,file2.jpg,fileN.jpg。
这将是巨大的,写服务器来管理上传的文件在我自己的自定义逻辑,但ckfinder是独立的dll库,我包括我的项目。
我无法弄清楚如何在适当的方式改变客户端的配置设置。这可能吗?

I am using ASP.NET version of CKFinder. I need to rename all uploaded files to names like: file1.jpg, file2.jpg, fileN.jpg. It would be great to write my own custom logic on the server to manage uploaded files, but ckfinder is standalone dll library that i include to my project. I cant figure out how to change config settings on client side in proper way. Is it possible?

推荐答案

好吧,我想通了,如何解决我的问题。当您从官方服务器下载CKFinder压缩包有一个与源$ C ​​$ C Visual Studio项目。
我们需要找到 FileUploadCommandHandler.cs 类,位于 CKFinder.Connector.CommandHandlers 命名空间。
我们需要找到 SendResponse(...)方法。然后找到 sFileName 变量。在这里,我们可以写主要逻辑旁边我们自定义的逻辑,就像这样:

Well, i figured out how to solve my problem. When you download CKFinder zip package from official server there is Visual Studio project with source code. We need to find FileUploadCommandHandler.cs class, located in CKFinder.Connector.CommandHandlers namespace. We need to find SendResponse(...) method. Then find sFileName variable. Here we can write our custom logic beside main logic, like so:

//custom logic
sFileName = Util.MyCustomRenameLogic(sFileName);
//other logic

此外,我们可以分析所有code,它是pretty简单。例如,我们可以添加我们的自定义逻辑来重命名文件,文件夹,改变图像质量,使打印水印等。

Also we can analyze all code, it is pretty simple. For example, we can add our custom logic to rename files, folders, change images quality, make watermark prints and so on.

这篇关于CKFinder。重命名上传的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆