I had a hard time finding plugins that would serve as image/file uploader for Tinymce. I tried ibrowser but it didn’t work in Filefox and it hung easily in IE. It might be related to the write permission of the temp directory. I didn’t make it writable. I didn’t go back and try again.

Then I found Tinymce Ajax File Manager at http://www.phpletter.com/Our-Projects/Tinymce-Ajax-File-Manager-Project/

The confusing thing is the download link for  Tinymce Ajax File Manager goes nowhere, you can only download Ajax File Manager. It eventually worked though.

Add the following lines to your javascript common file:

1. function ajaxfilemanager(field_name, url, type, win) {
var ajaxfilemanagerurl = “../ajaxfilemanager/ajaxfilemanager.php”;
switch (type) {
case “image”:
break;
case “media”:
break;
case “flash”:
break;
case “file”:
break;
default:
return false;
}
tinyMCE.activeEditor.windowManager.open({
url: “../ajaxfilemanager/ajaxfilemanager.php”,
width: 782,
height: 440,
inline : “yes”,
close_previous : “no”
},{
window : win,
input : field_name
});
}

In tinyMCE.init({…

add or change:

elements : “ajaxfilemanager”,
plugins : “table,paste,advimage,advlink,media,contextmenu”,

file_browser_callback : “ajaxfilemanager”,
relative_urls : false   //this line is good if your upload directory is above your admin area.

My next problem is that when you select a file, there is no way to insert the image location to the Tinymce image file field! Turns out I didn’t change CONFIG_THEME_MODE (CONFIG_EDITOR_NAME) to tinymce!

Still, it behaves oddly in IE: if there are more files than one page on the rightside browsing pane, when you click the checkbox to select one file, you are actually selecting the file in last page… The newer version of AJAX File Manager (1.0 RC4) fixed the problem.

The pr0blems I can see still:

1. In Firefox, if you open the File Manager twice in a row, the select function stops working. You have to either change the directory or toggle the detail/thumbnail view button to re-activate the select button. In IE, it seems OK.

Tinymce image upload plugin

2 thoughts on “Tinymce image upload plugin

  • March 16, 2009 at 11:36 pm
    Permalink

    A new issue: when you upload to a directory, files with name like 304859u2 start appearing. Turns out there was a corrupted file in that folder that is duplicating itself. Re-saving the file in a image editor and uploading the file fixed the problem.

  • December 13, 2010 at 12:51 pm
    Permalink

    ajax file manager

    FileUltimate is an ASP.NET file manager control which you can add directly to your existing ASP.NET (.aspx) pages. The control renders a user interface similar to “Windows Explorer” within the page and this user interface allows you to view the contents of the predefined root folders and allow complete file management actions within those folders. File management actions can be limited by predefined permissions and quota limits on each folder separately.

Leave a Reply

Your email address will not be published. Required fields are marked *