问题
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?
回答1:
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
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.
来源:https://stackoverflow.com/questions/29075955/ckfinder-rename-uploaded-files