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.4

Available language packs

What can File Manager do?

  • View the files in your Upload Destinations
  • 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.

Latest version 1.2.4 - 2008.07.05

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

Feel free to leave a comment or mail me at lodewijk (at) gmail (dot) com if you have a question.

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.

Comments

  1. author
    1 Justus Bruns 1 juni 2005, 18:06

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

  2. author
    2 Low 1 juni 2005, 22: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. author
    3 Willem 8 juni 2005, 08:54

    Gaaf, ik ga ‘m vanavond eens ff installeren

  4. author
    4 Jesse Bennett 17 augustus 2005, 22:09

    Thanks so much! This is awesome!

  5. author
    5 Jake Covert 16 oktober 2005, 02: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. author
    6 Nathan Pitman 26 januari 2006, 14: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. author
    7 Low 26 januari 2006, 15:06

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

  8. author
    8 Nathan Pitman 26 januari 2006, 17: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. author
    9 Low 27 januari 2006, 16:44

    Nathan, bug was fixed in 1.2.3.

  10. author
    10 Nathan Pitman 27 januari 2006, 17:22

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

  11. author
    11 Werner Gusset 16 februari 2006, 16: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. author
    12 Greg D 23 april 2006, 18:01

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

  13. author
    13 Slagers 29 mei 2006, 18: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. author
    14 Low 29 mei 2006, 21: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. author
    15 Nathan Pitman 16 augustus 2006, 23: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. author
    16 Jen 4 januari 2007, 06: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. author
    17 Low 4 januari 2007, 11: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. author
    18 Jamie 14 februari 2007, 06: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. author
    19 rob q 25 februari 2007, 23: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. author
    20 Low 25 februari 2007, 23:58

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

  21. author
    21 rob q 25 februari 2007, 23: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. author
    22 rob q 26 februari 2007, 00:09

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

  23. author
    23 Nathan Pitman 28 februari 2007, 18: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. author
    24 JT 2 april 2007, 10: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. author
    25 Low 2 april 2007, 16: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. author
    26 jamjammo 22 mei 2007, 09:48

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

  27. author
    27 Low 22 mei 2007, 10:00

    It is and it does, jamjammo.

  28. author
    28 John Faulds 31 mei 2007, 02: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. author
    29 Low 31 mei 2007, 08: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. author
    30 John Faulds 31 mei 2007, 12:27

    Ah, great. Thanks!

  31. author
    31 Plebe 17 juni 2007, 20:31

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

  32. author
    32 shelley 23 juni 2007, 23: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. author
    33 Low 26 juni 2007, 22:18

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

  34. author
    34 Victor 29 juni 2007, 03:24

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

  35. author
    35 Micheal 29 juni 2007, 04:24

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

  36. author
    36 Markus 9 juli 2007, 22: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. author
    37 Mike 17 augustus 2007, 17:22

    It’s very beautifully.

  38. author
    38 Nathan Pitman 28 september 2007, 22: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. author
    39 Stuart 1 oktober 2007, 19: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. author
    40 Low 2 oktober 2007, 21: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. author
    41 Travis Schmeisser 8 november 2007, 18:35

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

  42. author
    42 amarantcreative 7 december 2007, 19:35

    Great Module! Thanks a bunch…

  43. author
    43 Mvd 16 december 2007, 14: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. author
    44 Nico Smit 18 december 2007, 20:38

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

    zie http://www.swfupload.org/

  45. author
    45 bestann 26 december 2007, 19: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. author
    46 Hilary Nelson 5 februari 2008, 07: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. author
    47 Low 5 februari 2008, 09: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. author
    48 Hilary Nelson 5 februari 2008, 18: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. author
    49 Rachel 3 juni 2008, 11: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. author
    50 Low 3 juni 2008, 11: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. author
    51 Steven Hambleton 19 juni 2008, 05: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. author
    52 Low 19 juni 2008, 09: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. author
    53 david 2 juli 2008, 18: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. author
    54 Low 3 juli 2008, 09: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. author
    55 david 3 juli 2008, 12: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.

Leave a comment

Some html (a, em, strong, etc) allowed.


Zoeken in loweblog.com