MooTools based FileManager (1.0RC2)
I am not the guy who writes articles every other day, but fear not: I am planning to post further interesting Blogposts in the near future. For now, here is probably the biggest Script I've released as open-source: A MooTools based File-Manager for the web that allows you to (pre)view, upload and modify files and folders via the browser.
MooTools FileManager

Features
- Browse through Files and Folders on your Server
- Rename, Delete, Move (Drag&Drop), Copy (Drag + hold CTRL) and Download Files
- View detailed Previews of Images, Text-Files, Compressed-Files or Audio Content
- Nice User Interface ;)
- Upload Files via FancyUpload (integrated Feature)
- Option to automatically resize big Images when uploading
- Use it to select a File anywhere you need to specify one inside your Application's Backend
- Use as a FileManager in TinyMCE
- Provides your Client with the most possible convenience ( ;D )
Demos
Download
Integrate into your Application
The demos in the package provide a great overview on how to implement the FileManager. I have also packed two YUI-Compressed versions. One with every module + the English language file and another version containing all modules except the Uploader part.
Implementing the FileManager is really simple (once you added the CSS and JavaScript):
var manager = new FileManager({
url: 'manager.php',
assetBasePath: '../Assets',
language: 'en',
uploadAuthData: {session: 'MySessionId'}
});
$('example1').addEvent('click', manager.show.bind(manager));
The PHP-Code to implement the FileManager:
<?php
include('../Backend/FileManager.php');
$browser = new FileManager(array(
'directory' => 'Files/',
'assetBasePath' => '../Assets',
'upload' => true,
'destroy' => true,
));
$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null);
For more configuration options on either the client- or server-side please have a look at the Backend/FileManager.php file or the Source/FileManager.js file
Open Source
The FileManager is released under the MIT-License so I hope you have fun with it and you can get a great use out of it. Please, if you have space on your uber-cool Web-Application to add an acknowledgement and a link back to my Portfolio, I'd appreciate it a lot 
Any subsequent releases until the 1.0 version of the FileManager will be "drop-in"-releases. This means no update will require you to change any line of your code.
If you want to help improve this FileManager, fix bugs, write documentation, write code for a backend in another language or simply implement features contact me, have a look at the Project on GitHub and fork me:
Browser Compatibility
The Script has been tested in Firefox 3+, Safari 4, Opera and IE6+. As this is an "RC" I expect it to have some minor glitches in some browsers (namely IE). There is no PNGfix whatsoever provided so if you desperately need one please implement it yourself. There is no warranty that the excessive use of the Uploader will crash your little Internet Explorer for no reason.
Acknowledgements
- This Script is loosely (!) based on a Filebrowser by Yannick Croissant: Brooser
- The FileManager makes use of the soon to be released FancyUpload 3.0 by Harald Kirschner. Thank you for your efforts, Harald!
The Uploader.js and the FancyUpload files are "drop-ins". Just add the ‹script /›-Tags to include the files and the upload button in the FileManager-Menu will appear. Please note that the Uploader integration will require MooTools 1.2.2 as the Class-System prior to it had some shortcomings.
Changes from 1.0RC1 to 1.0RC2
- There are now 8 Languages available for the FileManager: English, Spanish, French, German, Swedish, Finnish, Czech and Danish
- FancyUpload update, changed so it is possible to upload duplicates and some adjustments for the error messages when Flash is not available
- Adding a "hideOnClick" option to close the FileManager when the overlay is clicked
- You can now press enter in the input fields in the Rename/Create Dialogs and you can close any dialog by pressing the ESC-Key.
- Resetting the headline (h1) style so it doesn't destroy the style of the FileManager.
- Minor fixes in the back end
Leave a comment
74 comments on MooTools based FileManager (1.0RC2)
syn4k posted on 4th February 2010
syn4k posted on 3rd February 2010
click: function(){
return false;
},
I know this because I added an alert here and it echoed back to the browser. How do I get this fixed?
My manager.php:
<?php
include('../plugins/filemanager/FileManager.php');
$browser = new FileManager(array(
'directory' => '../files',
'assetBasePath' => './Assets',
'upload' => TRUE,
'destroy' => TRUE,
));
$browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null);
dungkhung posted on 7th January 2010
beazleybub posted on 29th December 2009
When uploading a large file say 100MB the upload progress bar doesn't really give an accurate idea of how much has been completed. But if you place your mouse cursor over the progress bar you see something like 72% etc.. Is there any way to place a numerical representation of the upload progress on the page?
Thanks for your great script! I have tried over fifty+ file manager scripts and none come close to being what yours is.
schmooser posted on 3rd December 2009
pete posted on 27th November 2009
fletch posted on 6th November 2009
Thanks
Foxy posted on 2nd November 2009
First i wanna thank you Moo tools for their great work,it's an awesome handy tool.
In local i used it with Tiny mce,all works fine,but when i uploaded it to my webserver,i got this error: "You had to install Adobe flash to upload files" despite i've Flash player installed!
Can anyone help me on this issue please.
For information: My website is on a free web host 000webhost Unix servers.
Regards,
Foxy
Raphael posted on 2nd November 2009
This plugin is absolutely awesome.
It works on my Localhost, but when I upload it in my webserver, it doesn't work.
My localhost => php 5.3.0
My webserver => php 5.2.0
In php 5.2.x, the finfo_open function doesn't exist. Do to think that it is the problem ?
Regards,
Chris posted on 2nd November 2009
Whipster posted on 14th October 2009
absolutely awesome file manager man.. I well appreciate it.
However, I run into a problem uploading files with a .JPG extension... any ideas? "The uploaded file has an unknown or forbidden file extension." - I've been searching all over the JS stuff to try and find where I can add support for it... but to no avail.
anayways, regardless - this is brilliant, thankyou!
Buja posted on 13th October 2009
thnx
magic77 posted on 12th October 2009
is it possible to deliver a userid to the manager.php like this
$browser_moo = new FileManager(array(
'directory' => '../images/user/'.$cUID.'/',
'assetBasePath' => '../includes/mootools/FileManager/Assets',
'upload' => true,
'destroy' => true,
'maxUploadSize' => 1024*1024*32,
'safe' => true,
'filter' => 'image/'
));
where $cUID is set up in js
var manager = new FileManager({
url: 'filemanager_mootools.php?cUID=17828',
assetBasePath: '../includes/mootools/FileManager/Assets',
language: 'de',
selectable: true,
uploadAuthData: {session: '{/literal}{$central_user_id}{literal}'},
onComplete: complete
});
$('fm_button').addEvent('click', manager.show.bind(manager));
but this doesn´t work
minovec posted on 5th October 2009
Standart implementation of filemanager is:
var manager = new FileManager({
url: 'manager.php',
assetBasePath: '../Assets',
language: 'en',
uploadAuthData: {session: 'MySessionId'}
});
$('example1').addEvent('click', manager.show.bind(manager));
BUT I need run filemanager from clasical onlick as example:
<a href="#" onclick="show_manager()">Show file manager</a>
Its possible? any help?
Bruno posted on 30th September 2009
relayClick did not work for me in the latest from github(is never called on directory-click and for files it works only if I change
.store('block', true) to .store('block', false) in function revert ).
I copied the old code:
this.browser = ...............inject(this.el);
from rc2 and seems to work.
I have a new issue though.
For now, I have hacked the code to solve the issue...
plugins/filemanager/Source/FileManager.js was hacked to remove the download feature since it is broken in all browsers
I simply commented out:
//if(file.mime!='text/directory')
//icons.push(new Asset.image(this.options.assetBasePath+'disk.png', {title: this.language.download}).addClass('browser-icon').addEvent('click', (function(e){
//e.stop();
//window.open(this.normalize(this.Directory+'/'+file.name));
//}).bind(this)).inject(el, 'top'));
plugins/filemanager/FileManager.php was hacked to remove the download feature since it is broken in all browsers
echo json_encode(array(
'content' => $content ? $content : '<div class="margin">
${nopreview}<br/><button value="'.$url.'">${download}</button>
</div>',
));
became:
echo json_encode(array(
'content' => $content ? $content : '<div class="margin">
${nopreview}
</div>',
));