|
Author: Jenny Nguyen
|
|
We have a really cool CMS built in-house which uses the FCKeditor component. On one morning the user have ask if she could delete obsolete files that she has upload ages ago. I thought to myself hmm that is a good question, so I hit to the computer and fire up Internet Explorer, then I open up the CMS page and observe if I could delete the uploaded file from the file manager. To my surprise the delete function is not there, but I knew it must be for the security reason why the author did not wanted to have the delete function there. So if you really want to have the delete function and you know that it wont pose a great risk to your server, how would go about implementing the function? Well, thank god it’s not that to difficult. You will most likely need to modify just five files to have the delete function working.
Change of what is hightlighted in yellow oListManager.AddFile = function(fileName, fileUrl, fileSize) { // Create the new row. var oRow = this.Table.insertRow(-1); // Build the link to view the folder. // Get the file icon. // Add the file icon cell. // Add the file name cell. // Add the file size cell. Then add this sub-routine near the end of the file function DeleteFile(fileUrl) { function DeleteFileCallBack(fckXml) { Sub RemoveFile(ByVal resourceType, ByVal currentFolder) If fso.FileExists(sDeleteFileName) = True Then fso = Nothing 3. connector.asp - \FCKEditor\editor\filemanager\browser\default\connector\asp\connector.asp ' Execute the required command. If you are using the asp.net connector then you have to change it to use the asp connector as currently I have not come up with a solution to use the asp.net connector.
Ensure that the configIsEnable = true.
Dim ConfigIsEnabled
ConfigIsEnabled = true 5. fckconfig.js
Then make sure that you have change the ConfigUserFilesPath to the correct path. This is the upload path of files. Open up the file fckconfig.js and modify the following line. Make sure that the connector.asp is uncommented and comment out the connect.aspx because we are not using the asp.net connector.
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp' ;
//FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/CustomFiles/' ; //FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/aspx/connector.aspx' ; There you have it you can test it out and see if you now can delete file in FCKeditor.
Comments (11)
"
|
in my version 2.30, file frmresourcelist.html does not contain these lines.