contextmenu for fckeditor's filemanager

A few clients of mine had asked me how to rename or delete files and directories in our CMS after uploading with FCKeditor.

There was no way to do it.

I decided to check the FCKeditor forum to see if soemone else might have solved it already. There were ways to do it using addons, but the integrated filemanager did not have a way to do it.

So, I suggested that I would give it a shot.

I had never written a context menu before, so went digging through the FCKeditor source to see what I could see.

After an hour of reading, I was still none-the-wiser, so did it from scratch.

The Demo – once it’s loaded, click the Image icon, then Browse Server. try uploading a small file, then rename it and delete it. You can also create and edit folders/directories.

I’m pretty happy with this one. The solution was very tidy, and I will be using the code again in the future.


  1. This is just cool… Are you going to submit your changes to FCKeditor too? I’d love to have this feature too!

  2. I already have, and although it has not yet been added to the CVS (if I read this thing correctly), I believe it will be available as default in version 2.3.

    I have some other thoughts on the file manager – tooltip “thumbnails” of images, for example, but I have a load of other stuff I need to work on first, so I’ll leave that one for another day.

  3. Hey,

    This is just beautifull. I tried downloading a bz2 file i found linked on the fckeditor forums, but it did’nt work. Soooo i was wondering if there is somewhere i could grab this addon ?

  4. Bouche, see here for updates on this:

    note that you will need to edit the connectors/php config to point to your own userfiles directory

  5. Wow! Perfect. Just what I was looking for. Thanks for putting this out there. I will be doing some modifications to it in order to make it work with ASP.NET, and will try to add it back into the source repo.

    Great work.

  6. Ryan, note that there may be problems with large images. I haven’t put sufficient error checking in there to handle all eventualities. My in-house copy is more robust, and clears all generated variables, to try to keep down the RAM usage, but it still has trouble with very large images (a test case I’m using is 2560×1920).

  7. This is working 99% (THAT is saying something), congrats !

    I found a bug in your script: while browsing directories, in the directory sidebar, it shows twice every directory listing…

    Everything else is working fine… Thanks, i was looking for something like this.

    Is is compatible with $Config[‘ConfigDirectories’][$sType] custom directory configuration??

  8. Arathael, I think the problem you’ve mentioned (double appearances of directories) may be a problem with the async method I use with AJAX. You may be clicking onto another directory before the first one is loaded, so when the results arrive, two sets are drawn.

    I am not supporting the old file manager anymore, but if this problem occurs in my new one (which I see from other posts you have found already), then I will fix that immediately.

  9. Hey great work indeed, but, do you have any update about inclusion in the FCKEditor release?
    It’s hard to believe they wouldn’t want to include such an elegant solution in the official distribution…

  10. Maido, thanks.

    No, I don’t believe they will be taking this into their own code. Perhaps because they need to be cross-compatible with a number of server-side languages, but I only wrote it for PHP.

    However, there is a good solution to this – ignore the work I did there, and take a look at this: – it’s a plugin which basically re-writes the entire file manager using pure AJAX methods, and can be used simply for any version of the FCKeditor (see the readme.txt for details). There are some very ambitious plans for it.

  11. Could you make the source code available for this project? I would love to have such a simple solution to this “delete” problem of the FCK filebrowser.

  12. XeNTaR, I no longer support this. There were some problems with some of the code.

    instead, please try KFM version 0.7.1 (or above).

  13. This is really beautiful. I tried the one from KFM, but that didn’t work out. This one is simple, easy and very user friendly. They should really use it in fck 2.4.

  14. Willem, I don’t think they will. You can see from the date of the post that it’s already almost a year old, and yet FCKeditor still doesn’t use it, even if just for the ability to rename or delete a file.

    Personally, I’m still developing KFM 😉 I believe it’s a better file manager.

  15. I would love to only have a context menu for a delete file action, exacly the way you did it here:

    Is the source code of the context menü stil available? I didn’t find a download link..

  16. here’s a zip I made from the “editors” directory a while back, which includes that contextmenu. you’ll need to dig through it to find the filemanager code.

  17. That’s great! I like it so much 🙂 Thank you. But I have a question. I simply change the folder “filemanager” with yours and change some lines. It works but can not show tumbnails altough images’ sizes are quite small. It just shows width, height and type of the image. Is there any option in the code to run this event or what is the problem you think?

  18. it’s hard to tell – could be anything. I don’t actually support this hack anymore. Instead, I recommend you look at this: – it’s a total replacement for the file manager

%d bloggers like this: