Hi,
As we all know image, any file actually, management is one of Drupal's biggest weaknesses. It has been debated since the beginning and there exist a virtual labyrinth of different solutions for it. I would say that looking at all the modules touching this more or less all features needed for Drupal to have excellent file management exist. The problem though is that very little is compatible with each other (won't go into that snake pit in this post though...)
Personally I like the concept of files as nodes. Together with taxonomy, CCK, etc. it offers an incredible flexible way of adding images as well as all surrounding meta data and other information needed when using the files on the site.
It is when using these files the issues starts to mount up, especially when wanting to embed them in the body and keeping track on where and how they are used.
I have lost track on the number of times I thought I "finally nailed it" just to get disappointed when testing if it would work in practice.
For me the problem actually seems quite simple. I want to be able to upload images, and other files, that then will be used on pages in a controlled fashion. Thats where the file as node comes in as it let me connect all directly related info to a file in the content type, including copyright, references to uploader, description, captions and so on.
Optimally would of course be to have a file table in the db that separates files from nodes. Thus nodes are only used for none file content, but everything that can be done on nodes will still be possible on the files table as well, including CCK, views and so on. It simply separates the files into its own table.
Then I want to create a number of presentation formats to be used when embedding these files in the Wysiwyg editor, gallery and other place, while at the same time keep track on where they are used.
The closest i have found so far to a solution is Newspaper modules open-sourced by Studio Multimedia France 24 / RFI. I did a test installation and it works pretty well.
While I really like the features it offers, these modules was developed for the France 24 site and thus they are not really generic and flexible enough to easily be used on other sites. For me they do contain quite a bit of "hacking" to making it work for the exact needs of France 24 (nothing wrong with that and still a big thanks for open sourcing them) that limits how I can use them as a solution on my sites.
There are a number of other projects going on as well, such as especially the media group, however it seems to fully focus on Drupal 7 (which I don't have anything against) and work on the Drupal 6 versions seems to have come to an halt.
Since the site I am working on will be D6 based it leaves me with an "almost" solution. I can create a content type for the files that will contain all the information we need for it, but then be able to use it in a flexible way, such as being able to select a style/format to embed in the wysiwyg editor remains to be solved.
I would really be grateful for some tips and pointers on this. I do know a bit of PHP, but very little about javascript and Drupal module development.

Comments
_
Hi Edde42,
I totally sympathize with you, as file management has always been a challenge to get things exactly the way you would want them, and I generally have simpler needs than you as I haven't really had the need to track every reference of a file or deal with file based taxonomy.
My modules are a perfect example of not being able to achieve everything I wanted with file management and will probably continue to be so:
FileField Paths - sorting/renaming files based on node tokens,
File Aliases - creating '/sites/default/files'-less urls to my files while keeping the actual files in that directory,
ImageField Tokens - using node tokens to provide default ALT/Title fields,
etc.
I have always found the FileField/ImageField approach to be the best route as it is a lot less complex for end-users to tackle than File system/File manager based approaches like that of IMCE and others (IMHO), and it utilizes the 'files' database table, but mostly because of being CCK based it offers so much flexibility for alterations, hence my modules.
And the CCK formatters functionality is fantastic for defining different output/presentation styles; checkout Custom Formatters, another of my modules that provides a simple(r) interface to create your own CCK formatters.
There are an abundance of FileField/ImageField add-on modules out there, including some of quicksketch's own such as Insert for sending a CCK formatted reference to your node's body and FileField Sources for referencing files uploaded to other nodes, so with a little research or even a little work rolling your own you should be able to get 95% of what you need cobbled together.
I'm also working on yet another module in the same vein as quicksketch's Insert module, which provides (somewhat) native Drag (from your desktop/filesystem) and Drop (onto a node Textarea/WYSIWYG) upload support using FileField/ImagField to handle the files and leveraging CCK Formatters to reference the uploaded file. It is still in beta and needs work, but it does work in the right circumstances (browser version, WYSIWYG editor being used, etc), but it is something I will continue improving as I believe the benefits of such a module for simplified uploads is huge. It is Drag'n'Drop Uploads.
While maybe not as simple as having one module to rule them all, I honestly don't think that is really the best approach and definitely not the Drupal approach, however a 'feature' built from a combination of these modules would definitely help simplify things.
It would be great to hear how other people are handling their files, what requirements they have for their files and how they are achieving it, whether it be like me attempting to solve all their issues with their own contributed modules, or whether they have stumbled across a good set of modules that work for them perfectly.
Cheers,
Deciphered.
Another Solution
I think that one solution that is a lot of times overlooked for managing files in Drupal is the integration of the Alfresco (www.alfresco.com) document management system with Drupal.
Alfresco is more of a CMS for document management and you can do everything from drag and drop to access the file repository using Windows Explore and Apply Finder via WebDAV.
I think that by integrating the 2, you can benefit from the simple to use Drupal front end and the feature rich Alfresco file management backend.
The CMIS Module: http://drupal.org/project/cmis_alfresco allows you to integrate Drupal with Alfresco easily.
Regards,
Arnold
Hi Arnold, I did take a look
Hi Arnold,
I did take a look at Alfresco when researching options for this. While it is an impressive product it would add too much overhead for us, as well as not being flexible enough for this project.
--
/thomas
T: @tsvenson | S: tsvenson.com
Hi Deciphered, Thank you so
Hi Deciphered,
Thank you so very much for taking time to write such a detailed reply to my post. Even though I am familiar with many, as well as already using most, of yours and quicksketch's modules your reply really helped to sort out several things for me. File Aliases I had misses and that is definitely going to be used on the site, big thanks for pointing that one out to me.
I am not really looking for the "one module to rule them all". The more I learn about Drupal, the more I like all the small modules that solves isolated issues while being flexible enough to be used for things the author often never had in mind when developing it. Its really one of the great things I have come to love about Drupal.
Your suggestions is pretty much in line with what I have come up with myself. As this is a completely new site I am working, one goal is also to make it as easy as possible to upgrade to D7 in the future. So basing everything on ImageCache, FileField, etc seems to be a good route for that. I am also not a big fan of the file system browsers.
I have sort of a sketch of a plan with a some blank spots I need to fill in:
Media Archive:
I don't see any problem building this part as it is quite straight forward using several of the modules you list as well as some other.
So, then I have a nice archive of images with all the surrounding information I can imagine, as well as a flexible tool to search and browse them. Now we come to the parts where I still are searching for solutions.
While I do like what Insert does my problem is that there isn't a way for me to use it to pull an image from another node. The image URL etc is stored in the same node as the content itself and that is what I am trying to avoid.
What I would like to have is the functionality of Insert but with the options to either select an existing image (using the media browser above) or adding a new image node directly from the content node creation page.
The optimal would be if an unpopulated insert had a button like "Select image". Clicking on it would bring up the media browser in an overlay. I can then search all existing images, including seeing previews of all the ways they can be embedded in the content based on the CCK formatters/Custom Formatters available.
If I select an existing image, then the "Insert" field will simply be populated pulling the needed image URL and information from the image node. At the same time it will add a reference to the image node that it is using that image.
If I don't find a suitable image I click on the Add/Upload image in the browser overlay and it will switch to the add image content type where I can upload the image as well as fill in all the surrounding information. When done I simply click save and again the "Insert" field will be populated automatically. The image node will also get the new content node as original source for where the image was first used.
I think, the way I want to implement it is quite straight forward. The image archive, the media browser and embedding formatted images on content nodes doesn't seem to be much of a problem. However, what it all seems to fall flat on is that Insert can't pull the information from another node, the image must be uploaded to the same node as will be used for publishing the content.
All the other features seems to exist in existing modules unless I have completely missed something.
--
/thomas
T: @tsvenson | S: tsvenson.com
_
While some of what you are looking for doesn't specifically feel necessary to me (File as Node, could be done with some extra fields attached to the FileField, like ALT and Title are), I do completely understand what your looking for.
The closest existing thing that I personally know of is a module called Image Browser, which I admittedly haven't used. I don't know enough to really talk about this module, but I believe that it is confined to use with WYSIWYGs and doesn't use FileField/ImageField, but I could be completely wrong in saying that.
I would suggest having a look into it, and even if it isn't what you want it could definitely be a starting point for the module that you have described above.
Cheers,
Deciphered.
I have looked at that module,
I have looked at that module, I ruled it out a long time ago due to that it required the Image module. I just looked at the 2.x dev version and in the README.txt it doesn't do that anymore so I will definitely take a new look at it.
As you say, it doesn't offer everything I need, but it might be a usable temporary solution.
Thanks,
--
/thomas
T: @tsvenson | S: tsvenson.com
Oki, been digging away in new
Oki, been digging away in new directions after reading up on Image Browser.
First though a quick question regarding File Alias (haven't tried it yet). I am using Pathologic to fix broken links for files in the RSS feeds. Do you know if there will be any issues with both of them installed?
Oki, back to image browsing. In Captions, custom alt-text and title I found an interesting discussion, as well as a link to ImageField Extended which of course turned my whole plan upside down.
With the new information, including better understanding about what will happen in D7, I believe I have been going the wrong direction. Maybe the best way is to try to find a more simple method, using the file db, as a temporary compromise while monitoring where this is going.
Well, if it is one thing that is almost driving me crazy with Drupal it is image (file) management. Every time I seem to think I have a solution something new pops up and turns it completely upside down...
--
/thomas
T: @tsvenson | S: tsvenson.com
_
Haven't looked into Pathologic, looking into it now though, will let you know.
As for the other stuff, I honestly think the best solution would be a FileField/ImageField module in the vein of Image Browser, that way you could take advantage of things like ImageField Extended and all the other great add-ons. However without the module existing it does complicate matters.
If you could live without the GUI side of the ImageBrowser, FileField Sources is a good option (although in dev) to reference files uploaded on other nodes.
So basically for a GUI-less version of what you want, you would need:
- FIleField
- ImageField
- ImageField Extended
- Insert
- FileField Sources
And then of course you could add many of my modules into that mix as well :)
Though I'm guessing that isn't going to do quite everything you want, not sure about the permission based file thing, whether FileField Sources would only show files uploaded by the current user or all files.
__
Careful Deciphered, if I end up (very likely) using many of you modules it is very likely you will be "bombarded" with feature requests etc :).
On the matter of what approach to take, I once again have to thank you for taking your time to discuss this with me and help me iron out several of the issues and concerns we had. As you might guess we have been changing direction several times when it comes to going the node route or the files db route. I think that is just natural when it comes to Drupal as image/file management is a virtual minefield. The more you you research about it, the more confusing it gets.
Saying that, this discussion has been very educational for me and I it seems that the files db is a better approach, its where the Drupal community is moving and it is how D7 is doing it.
Even though we wont be able to get all we want, we can get quite far and then combine that with some manual work until we come up with a more automatic and fully managed solution.
I was actually looking at a FileField, ImageField, Insert, etc solution a few weeks ago, but scrapped it due to concerns about that I thought it would be hard to manage when the images where tied to the nodes they where uploaded to. During this discussion I have got a much better understanding about how the files db works which more or less killed that concern.
--
/thomas
T: @tsvenson | S: tsvenson.com
_
It occurred to me that File Aliases doesn't actually have anyway for the Alias to be automatically used in the Node Body and CCK Text fields, which seems like a fair oversight. I have remedied this and will commit the code ASAP, so when using Insert of Drag'n'Drop Uploads or an other method to get the unprocessed file path into those fields, it will now be converted to the file alias on save.
As for your question about Pathologic, didn't have any issues while testing, think it's pretty safe.
Cheers,
Deciphered.
Coolio, I managed to help you
Coolio, I managed to help you a little bit then as well.
Does this mean File Aliases will work as an input filter for the body text. If so, I presume it needs to do its magic before Pathologic does its and rewrite the URLs to static to work with RSS.
Actually, thinking of it, it does seem to me that it would be natural to add the Pathologic feature to the File Aliases.
--
/thomas
T: @tsvenson | S: tsvenson.com
Image Assist: the Good and the Bad
Image Assist is both the most hated solution but probably the easiest out-of-the-box solution. Several editors of The Cornell Daily Sun, former and current including myself, have an agenda against it, but we're still somehow stuck with it.
__
Hi Mike,
Image Assist is probably closest to what it is I am after, but since Drupal is moving in a completely different direction when it comes to file management it would not be a smart choice for a new website. Especially since we want as smooth transition to D7 as possible when time comes.
After the umpteen amount of information and discussions I have consumed when it comes to Drupal and file management I can understand you feel stuck with it. With the changed to file management in D7 I am sure it will sooner or later exist tools that will let you migrate all your existing files to D7 style more or less automatic.
--
/thomas
T: @tsvenson | S: tsvenson.com
I've been plotting the image
I've been plotting the image strategy for a new site, and we've been doing a mix of image attach (for news article) and D7-style (I think?) for galleries. It just feels like it's asking for trouble, but I was assured at a recent local meetup that it wouldn't be too much trouble down the road.
Now you've got me wondering: I like the ability of an editor to upload and place and configure their own images, but it might be too much prowess, an if doing image files two seperate ways is going to lead to trouble down the road, maybe it's best to just bite the bullet and use image cache all the way.
Web guy, SpareChangeNews.net
Twitter: @morisy / @sparechangenews
__
Hi morisy,
I see you been down the same routes and detours as me :)
I basically decided that if this site is every going to be done we had to take a decision and then stick by it. I would say that this has been the major issue for delays.
So I decided to bite the bullet, as you lay it out, and only use ImageCache based image management.
We are not going to get everything we want, but we get pretty far and so far we have identified compromises with not being able to have everything automated and GUI controlled. I am doing as much automated as possible, using most of the modules mentioned in this discussion plus a few more, and then some manual tasks needed when uploading or reusing images.
The idea is the get the site up and running and then when we have time and resources fill in the remaining blanks to get the fully automated system want.
--
/thomas
T: @tsvenson | S: tsvenson.com
Imagecache
Hi,
I'm developing a newspaper with 3 images presets and I would like to let the user upload his own picture in case he doesn't like the ones that are generated automatically by imagecache.
I've read the article at New York Observer - a newspaper site and found that is possible but I don't no how to do? Any ideas?
Regards,
Isabel