EE: File Manager Module

File Manager, an ExpressionEngine module to — guess what — manage your files!

In ExpressionEngine, the only place - not taking the Gallery Module into account - to upload files, is in the ‘Publish’ section. I decided that wasn’t good enough, so I built this straight forward module to improve the file handling, without having to resort to your FTP client.

Download the File Manager Module version 1.2.5

Available language packs

What can File Manager do?

  • View the files in your Upload Destinations
  • Filter the view of your files
  • Batch delete files from your Upload Destinations
  • Batch upload any number files to your Upload Destinations1
  • Resize images (if they are too large for your Upload Destination)
  • Create or delete directories on the server
  • Restrict access according to Upload Destination/Member Group rights
  • View or edit files on the server2

What won’t File Manager do (yet)?

  • Change directory or file permissions (chmod)
  • Move or copy files on the server
  • Keep track of downloaded files (how many times, when, by whom, etc.)
  • Provide a front-end interface for managing files

I tested the module on several installations of ExpressionEngine 1.2.1 build 20050123 1.3.2 build 20051010 and onwards without problems. There might be some issues if your server has safe_mode enabled, so use at your own risk!

New in version 1.1

New feature: you can now choose to resize the uploaded images if their width and/or height exceeds the maximum width/height of the Upload Destination. For this, you need the GD library. You could use other image manipulation libraries like imagemagick or netpbm, but for this, you need to edit the mcp.file_manager.php file, so only do this if you know what you’re doing.

New in version 1.1.1

Compatible with ExpressionEngine 1.3.

New in version 1.2 - 2005.12.05

  • Image resize preferences are now fetched from System Preferences → Image Resizing Preferences.
  • Create a server path specified in an Upload Destination if that path doesn’t exist on the server.
  • Delete a server path specified in an Upload Destination if that path (i.e. directory) is empty.
  • Upload Destinations can only be used by users who have enough rights. Rights are set under File Upload Preferences.

New in version 1.2.1 - 2005.12.09

  • Dynamically add or remove file input fields, so there’s no limit to the batch size.1
  • Some impovements in the way image dimensions are calculated.

New in version 1.2.2 - 2006.01.19

  • Non-writable ascii-files can be viewed on the server.
  • Writable ascii-files can be edited on the server.2
  • File lists are now sorted by file name, case insensitive.
  • Added “Copy and Paste” option to the Upload Result screen, for easy copying and pasting into a weblog entry.

New in version 1.2.3 - 2006.01.27

  • Redesigned the File Manager home-page.
  • Added “Copy and Paste” option while viewing files, for easy copying and pasting into a weblog entry (select files, select ‘view copy and paste info’, click submit).
  • Fixed a small bug mentioned here.

New in version 1.2.4 - 2008.07.05

  • Increased compatibility with the Multiple Site Manager, as suggested.

Latest version 1.2.5 - 2008.10.30

1 Number may be limited, depending on file sizes and webserver capability.

2 Editable file types are hardcoded in the mcp.file_manager.php file. By default they are: .txt, .php, .html, .htm, .css and .js.

May 25th 2005 | Add-Ons, ExpressionEngine | 75 comments


Comments

  1. 1 Justus Bruns June 1st 2005, 17:06

    Ik wou even zeggen dat je site verdomd veel lijkt op http://www.blocparty.com

  2. 2 Low June 1st 2005, 21:29

    Of de site van Bloc Party lijkt verdomd veel op die van mij… In ieder geval heb ik een bestaande WordPress theme wat aangepast en een eigengemaakte foto bovenaan gezet.
    Mmmdus…

  3. 3 Willem June 8th 2005, 07:54

    Gaaf, ik ga ‘m vanavond eens ff installeren

  4. 4 Jesse Bennett August 17th 2005, 21:09

    Thanks so much! This is awesome!

  5. 5 Jake Covert October 16th 2005, 01:09

    Would it be possible for the module to check to see if a file is being linked to from within EE before it deleted it?

    Knowing that this check would be costly (in terms of time), maybe a checkbox or something…

  6. 6 Nathan Pitman January 26th 2006, 13:02

    Brilliant. Exactly what I was looking for, although I think the screen from which you select the file location to view files in would be nicer as a list in the normal EE format rather than a drop down.

    A list format would mean just one click to select the upload location to view, whereas the select and submit method requires 2/3 clicks. :)

  7. 7 Low January 26th 2006, 14:06

    Good point, well made, Nathan. I’ll take that into account for the next version.

  8. 8 Nathan Pitman January 26th 2006, 16:09

    I just spotted a tiny little bug. If you upload an image which is resized on upload the ‘copy and paste’ code includes the original image dimensions and not the resized image dimensions. :)

  9. 9 Low January 27th 2006, 15:44

    Nathan, bug was fixed in 1.2.3.

  10. 10 Nathan Pitman January 27th 2006, 16:22

    Wow, that’s great. I’ll give it a go.

  11. 11 Werner Gusset February 16th 2006, 15:55

    Great module. I’ve done the german translation of the language file of 1.2.3. I’d like to give it to you to add it to the download package. Just don’t have an email address.

  12. 12 Greg D April 23rd 2006, 17:01

    Just installed this successfully in “ExpressionEngine Core 1.4.1″. Very simple and easy. Thank you!

  13. 13 Slagers May 29th 2006, 17:51

    Jow Low,
    Ik krijg de volgende melding (heb alles net geupload en geinstalleerd):

    Fatal error: Cannot redeclare class file_browser in /www/htdocs/debaasje/pmsystem/cp/cp.filebrowser.php on line 28

    Enig idee wat hiervan de oorzaak is?

  14. 14 Low May 29th 2006, 20:59

    @Slagers: Hmmm, volgens mij heb ik dat wel ooit eerder gezien… Maar ik heb het nooit echt kunnen reproduceren. Nu ook niet. Maar goed: wat is je EE versie (en build) en welke versie van PHP daai je? Tevens: wanneer krijg je deze foutmelding?

    Hoogst waarschijnlijk zijn je upload folders niet schrijfbaar. Controleer of je upload destinations ge-chmod zijn naar 777.

  15. 15 Nathan Pitman August 16th 2006, 22:55

    I had an idea for another feature while using your file manager module again the other day. I use Textile for markup in EE and the code it uses to ‘link to’ files and ‘embed’ images is different to that used by EE. It would be great if there was a way to specify which method the File Manager module used, or even some comments in the source so that thos like me can easily modify the code to default to Textile.

  16. 16 Jen January 4th 2007, 05:18

    First off, thank you so much for such a wonderful module!

    I am having one small problem though. I can’t upload any images. When I try to upload an image I get an error message that says:

    Upload result
    1.
    867frg-thumb.jpg
    The path to the image is not correct

    I’ve noticed that if the image already exists in the folder and I try to re-upload it, it will work then, but if there’s no image already there, I keep getting the error message “the path to the image is not correct.” I’m stumped. Any clue on what I’m doing wrong?

  17. 17 Low January 4th 2007, 10:51

    Jen, can you upload files using the native EE-way (in the publish/edit section of your CP), or do you get the same type of error?

    One thing to try: check your “Server Path to Upload Directory”, over at Admin → Weblog Administration → File Upload Preferences. Make sure the server path has a trailing slash. Something like ../images/uploads/

  18. 18 Jamie February 14th 2007, 05:51

    I’d love to be able to:
    (1) copy/move files between server directories and
    (2) zip/unzip an archive within a directory

    NB: Well done on the redesign. The site looks great!

  19. 19 rob q February 25th 2007, 22:53

    Hi, I just moved my website to a new webhost and when I attempt to access the file manager upload page I receive “Fatal error: Cannot redeclare class file_browser in /system/cp/cp.filebrowser.php on line 28.” I have not input the new paths for the upload destinations yet (new webhost /new upload directory paths) but I doubt that would cause any issues when trying to access the “upload new files” page. It looks like someone above may have had a similar problem but I can’t read that language. Thanks. Rob

  20. 20 Low February 25th 2007, 22:58

    Rob, make sure your upload folders are writable (chmod 777). That should solve the problem.

  21. 21 rob q February 25th 2007, 22:58

    Oh - also this happens on two different EE install versions, 1.4.2 and I upgraded to the most recent version 1.5.2; and the webhost (dreamhost) uses PHP Version 4.4.4.

    I’d be happy to have you take a look at the CP if you want. I can email you a login if you are interested. Thanks. Rob

  22. 22 rob q February 25th 2007, 23:09

    My above post criss-crossed with yours. You advice helped. It was permissions I believe. Thanks.

  23. 23 Nathan Pitman February 28th 2007, 17:05

    On more regular use of the File Manager module I have a small request. It would be fantastic if there was an additional column next to the ‘filename’ link which displayed the ‘copy and paste info’ or a link to it. There are far too many clicks involved at present; click the checkbox next to the item in question, scroll to the bottom of the page, change the drop down to read ’show copy and paste info’ and then click ‘Submit’. Plus it’s way to easy to try and delete a file by mistake. :)

    Keep up the great work.

  24. 24 JT April 2nd 2007, 09:41

    This module is great. I love it. Though it does have one issue for me.

    This is not if used as default, but if you use the TinyMCE plugin, you cannot use this module to insert any images. Users must use the file manager to upload, then already know how to include the image in their post.

    It’s a big drawback but I understand that the TinyMCE module wasn’t considered because it’s not part of the default EE install.

    Any chance this could be fixed?

  25. 25 Low April 2nd 2007, 15:41

    JT, the module is a stand-alone one, so doesn’t integrate with the publish section of the control panel, the way an extension would. That’s why you can’t use it to insert files like EE’s native upload tool. I did add the “copy and paste info” so you can copy and paste files into weblog entries without too much hassle. I did not, however, take any wysiwyg editors into account, and I’m not planning to do so either, I’m afraid.

  26. 26 jamjammo May 22nd 2007, 08:48

    Is this module still in development?
    Does it support version 1.5.2?

  27. 27 Low May 22nd 2007, 09:00

    It is and it does, jamjammo.

  28. 28 John Faulds May 31st 2007, 01:28

    I’ve just tried uploading some .flv files but am getting a ‘The filetype you are attempting to upload is not allowed’ error message. How do I get around that?

  29. 29 Low May 31st 2007, 07:40

    John, you need to add that file type to the mimes.php file in your /system/lib folder, ’cause EE doesn’t allow it by default.

  30. 30 John Faulds May 31st 2007, 11:27

    Ah, great. Thanks!

  31. 31 Plebe June 17th 2007, 19:31

    Oh my, this just plain makes you better. Awesome man, thanks!

  32. 32 shelley June 23rd 2007, 22:06

    Hi,
    I just installed this, but can’t find how to access it anywhere in the control panel. Where can I find it?

  33. 33 Low June 26th 2007, 21:18

    Shelley, you should be able to access it via the Modules tab.

  34. 34 Victor June 29th 2007, 02:24

    wow dit is wat ik nodig had..thanks en een landsgenoot ooknog heh

  35. 35 Micheal June 29th 2007, 03:24

    very nice indeed…shame you cant do live previuew of images instead of going off the page…very nice anyhow !!

  36. 36 Markus July 9th 2007, 21:36

    Really nice module - never installed it until now, but it seems to have some true advantages. I’d love to see some AJAX-ified preview of images in a separat div somewhere. So, when you move the mouse over the name (or a special spot/hot link), there would be a preview shown in that div in case the file in question is an image.

  37. 37 Mike August 17th 2007, 16:22

    It’s very beautifully.

  38. 38 Nathan Pitman September 28th 2007, 21:57

    Hi there. I’ve been using the File Manager module for some time and just recently deployed it as a part of a site that uses the new Multi Site Manager module that you can roll with EE 1.6. Whilst the File Manager module ‘does work’ it isn’t intelligent enough to know which file locations relate to which sites. Do you intend to add any new functionality to cater for the MSM?

  39. 39 Stuart October 1st 2007, 18:20

    Modules sees file manager but when I try to install it says “Unable to locate the files needed to install this module” I did put the language file in its proper place as well…

  40. 40 Low October 2nd 2007, 20:41

    Stuart, have you tried the EE forums to get help? I’ve never seen this issue before. Are you sure you named the new directory in “modules” file_manager?

    Micheal, Markus and Nathan, I’ll take that into account if I get round to updating the module.

  41. 41 Travis Schmeisser November 8th 2007, 17:35

    I tried editing the file types, but it still won’t allow me to upload .eps files. Any ideas?

  42. 42 amarantcreative December 7th 2007, 18:35

    Great Module! Thanks a bunch…

  43. 43 Mvd December 16th 2007, 13:52

    Thanks for the great module!

    Could anyone direct EE newbie as to what to modify so that File Manager would convert files it uploads to lowercase (something like the current “Replace spaces with underscores in filename?”). Modify module itself? Extension? Etc?

  44. 44 Nico Smit December 18th 2007, 19:38

    Misschien een idee om in de volgende versie gebruik te maken van swfupload?

    zie http://www.swfupload.org/

  45. 45 bestann December 26th 2007, 18:16

    I suggest to make not only File management module, but File Sharing module as http://www.centrixonline.com/products/od/index.html
    http://sourceforge.net/projects/olatedownload/
    Or maybe to give the idea to the EE team.
    That would be wonderful.

  46. 46 Hilary Nelson February 5th 2008, 06:23

    I’m working on a site for a public school in the U.S., and certain uploaded files and images need to be restricted so that only logged-in members can view or download them. I know how to set up a template so that only members will see a link to the files, but that doesn’t stop an anonymous user from viewing the files if they are given the URL.

    I was excited to see above that File Manager is supposed to “Restrict access according to Upload Destination/Member Group rights”, hoping that it would let me prevent anyone from getting a file if they aren’t logged in. So I installed it (EE 1.4.2), but I don’t see any apparent controls for setting access, other than the standard controls over who can upload to the destination.

    I’m guessing that I misunderstood what “Restrict access” meant, and that it was only talking about upload access, not viewing access.

    If anyone out there knows a way to use EE member logins to control viewing privileges on PDFs, DOCs, JPGs, etc., I’ll be extremely grateful if you can point me in the right direction.

  47. 47 Low February 5th 2008, 08:48

    Hilary, looks like you’re after the Download Lock module by Robin Sowell. That’ll take you one step closer to what you want.

  48. 48 Hilary Nelson February 5th 2008, 17:08

    Thanks, Low!

    I started reading the Download Lock description, and at first I didn’t think it would be sufficient, since it seemed like once a member was served a file, they’d be able to discover the actual location and perhaps publish that URL. Then I saw the bit about adding an htaccess file to the folder to prevent all HTTP access, allowing access only to scripts. Bingo!

    Now I’ve got to see if my hosting service lets me use htaccess files…

    Anyway, this sounds very promising. Thank you!

  49. 49 Rachel June 3rd 2008, 10:22

    I am new to EE and File Manager, I need a pdf library for my site and I decided to use File Manager, is there any way to display a list of files in the front end?

    This may be a very simple question, but I don’t see how to do it right now

    Thank you

  50. 50 Low June 3rd 2008, 10:56

    Hi Rachel. I’m afraid the File Manager module is Control-Panel-only at the moment. To generate a list of files in the front end, you’ll have to create a weblog that takes care of that. Or some custom PHP in your template, but that’s only an option if you know what you’re doing, so to speak.

  51. 51 Steven Hambleton June 19th 2008, 04:39

    Hi Low,

    Not sure if I missed it but is there a way of resizing images in upload? Also how do I access the original and _thumb image?

    Cheers!

  52. 52 Low June 19th 2008, 08:17

    Steven, the File Manager only resizes an image if it’s bigger than the dimensions defined in the upload destination. If that’s the case, it resizes the original image to the maximum width/length allowed. No _thumb image is created.

  53. 53 david July 2nd 2008, 17:15

    Low, I am also getting the error Stuart reported back in 2007…”Unable to locate the files needed to install this module”. I followed the instructions, added the language file…must be something odd about our install environments as it is obviously not an error a lot of people are getting.

    Can you suggest anything to check, or tell me what might throw that error? Thx.

  54. 54 Low July 3rd 2008, 08:12

    David, check out this post by Derek Jones about the same error message. He talks about a different module, but you could check the same things.

  55. 55 david July 3rd 2008, 11:08

    Er… embarrassing mistake actually. I saw the unzipped file and thought it was the one I should drop into “modules”…didn’t see the nested folder which was the correct one. Nothing to see here.

    Thanks.

  56. 56 Nathan Pitman July 10th 2008, 00:43

    @Rachel: We have developed a couple of bespoke commercial modules which deal with providing an interface for users to browse files (PDFs etc) both in a open manner and also with some security. Drop me an email if you’re interested…

  57. 57 Raquel September 2nd 2008, 17:23

    Does your extension support different categories for the files, for example, I have several pdf files which would be clasified in several categories. But I want to keep them all under the same directory.

    Is this possible?

    Thanks

  58. 58 John de Beer September 8th 2008, 07:33

    This is a brilliant module - thank you very much for making it available.

    I see that “Provide a front-end interface for managing files” is not available - yet! How about a clean and simple upload capability for the SAEF? I know there are a number of them out there, including the native EE capability, but if this module is anything to go by, my users would love the kind of ease-of-use that you have delivered in this module.

    Thanks again - John

  59. 59 wecreateyou September 18th 2008, 18:47

    I second the call for your “take” on the SAEF file upload.

  60. 60 Low September 21st 2008, 16:54

    @Raquel: you’ll have to set up several Upload Destinations yourself (any way you want), after which you can access them via the File Manager.

    @John de Beer and @wecreateyou: I’ll just wait for 2.0 and see if it’s still useful then. :)

  61. 61 Gradualist October 8th 2008, 20:25

    Hi Low, this module sounds great!
    Do you, or has anyone else, use it to upload really big files? Does it manage this successfully? I’m thinking of about 60mb tiff files. Is the upload protocol http or ftp?
    Thanks!

  62. 62 Low October 9th 2008, 08:06

    @Gradualist: the upload protocol is http. That’s why I do not recommend uploading really big files like that. In theory, the File Manager could cope with it, but it depends on php memory, apache (or web server) memory and timeout settings, and so on. I know there’s some people uploading files of 20mb+, but that’s pushing it, I think. Best use your ftp client for those biggies.

  63. 63 Nathan Pitman October 9th 2008, 11:00

    Hi there Low, I wonder have you ever had problems with the File Manager module when it’s trying to return folders which contain very large files (50+ Mb)?

    We have run into a situation with a client that has about 500 files in one folder (works fine but the module is a little slow, as you might expect!) and another with only 4 files, one is a 52.7Mb SWF, and another a 50.8Mb Zip. When I enable this file upload location File Manager will not render anything, no error, nothing, just a blank page… wondering if it’s a memory issue or perhaps a limitation of the module regarding returning file sizes or something?

  64. 64 Low October 9th 2008, 11:06

    Hi Nathan, the blank page thing does sound familiar. That usually comes up when you try to upload and resize a huge image. I think it has to do with some kind of memory limit, either in php or the web server itself. It could affect this as well, I guess. Have you tried to up the memory limit in the .htaccess file? Like this: php_value memory_limit 64M

  65. 65 Nathan Pitman October 9th 2008, 11:15

    ok, getting closer… commenting out line 1237 in mcp.file_manager.php allows me to actually see the module home page so I suspect the problem is with the ‘create_filelist’ function borking at files which are very large. So I can see the module home page now and navigate to certain file upload folders, just not the one with the large files in it.

  66. 66 Nathan Pitman October 9th 2008, 11:23

    It would be neat to have a preference setting to set whether or not to show file counts on the module home page as with large upload folders it slows thing down a lot. Even if this was just in the mcp.file_manager.php file as a flag at the top. One other nice addition would be the ability to have the module display and traverse sub folders. :)

  67. 67 Low October 9th 2008, 11:26

    I see, the $FB->create_filelist() is a native EE function. I would have to work around that. I’ll try and recreate this behaviour and maybe notify EE’s devs. I wonder, do you also get a blank screen when you try to view that upload folder using the popup window in the Publish/Edit section?

  68. 68 Nathan Pitman October 9th 2008, 11:30

    Yes, I hadn’t spotted that before but I do using that method also… as you say looks like a problem with the native EE function for returning files etc. Let me know how you get on! :)

  69. 69 Nathan Pitman October 9th 2008, 11:40

    A little more investigation reveals that it is the large SWF file which is causing the problem. If I remove it from the folder everything is ok but put it back and the same bug returns. Nothing unusual about it other than the file size, no spaces or strange characters in the name. FYI I have posted a bug report via the EE site. :)

  70. 70 Low October 9th 2008, 11:51

    One other nice addition would be the ability to have the module display and traverse sub folders.

    Actually, there’s a variable on the top of the file you could change to achieve just that: var $recursive = TRUE; One caveat: ‘Show copy/paste info’ won’t work properly for those files when you set $recursive to true. That’s why I didn’t mention it before… :)

  71. 71 Nathan Pitman October 9th 2008, 12:01

    Nice to know, thanks!

    This might be something to do with the native EE function for returning file info again but if you have a folder with a lot of files (500 in this case) then as you would expect it takes some time to return the file list, unusually though it also takes the same amount of time again to return the copy/paste info for 1 file. It’s almost as if it parses the whole folder list again just to get the copy/paste info for that one file…

    Sorry, I’ll stop bothering you now… I’m done. :)

  72. 72 Nathan Pitman October 9th 2008, 20:45

    Quick update for anyone else who is having the same problem with SWFs…

    http://expressionengine.com/bug_tracker/bug/5340/

  73. 73 Nathan Pitman October 30th 2008, 00:38

    Bit of a ‘Feature Request’… would be great to have a ’search tool’ at the top of the file manager as per the ‘Edit’ tab in the control panel. When you have a ton of files uploaded it would be super handy. :)

  74. 74 Dan Lee October 30th 2008, 18:15

    Nathan you said you were done… :)

  75. 75 Nathan Pitman October 30th 2008, 18:35

    I know, I just couldn’t resist. I’m determined to make this comment thread mine! Look at that new feature in 1.2.5 though! Booyakasha!!!

Leave a comment



Some html (a, em, strong, etc) allowed.
Email won’t be displayed and takes care of your Gravatar.