简体   繁体   中英

CKFinder. Rename uploaded files

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM