CKFinder. Rename uploaded files

拜拜、爱过 提交于 2019-12-20 06:37:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!