Want to get Lullabot article, videocast, and podcast announcements delivered right to your in-box? Let us know your email address (we won't share it) and we'll let you know when anything exciting happens.

FileField and ImageField 3.0 for Drupal 6 Released

Today I released the final 3.0 versions of both FileField and ImageField for Drupal 6, bringing to close the long journey for a stable, final release of the de-facto CCK image handling solution.

A small time line (in dd/mm/yyyy format):

  • 05/10/2007 - Hook file proposed for inclusion in Drupal 6
  • 02/13/2008 - Drupal 6 released (without hook file)
  • 06/24/2008 - First alpha release of FileField 1.x for Drupal 6
  • 07/31/2008 - RC1 of FileField 2.0 scrapped to start on a new hook file based version
  • 08/08/2008 - First alpha release of ImageField 3.x for Drupal 6
  • 10/08/2008 - Hook file included in Drupal 7
  • 03/15/2009 - New betas of FileField strip out crufty APIs
  • 04/20/2009 - Final versions released

And here we are! Nearly 2 years after the original concept of hook_file() was created and the work on FileField 3.0 began.

Let's take a tour through the final version and see what we have!

The FileField Widget

Probably the most exciting improvement is the addition of upload progress indication. This enhancement requires the PECL uploadprogress PHP extension, but adds a real asset to sites that use FileField for podcasts, videos, or other large files.

The upload field in action. Uploading with the uploadprogress extension installed.

 

After uploading a file, a simple preview and additional fields become available. "Description" and "List" fields may be toggled per instance.

Support for Revisions and Translations

FileField contains a backport (or actually the predecessor) of hook_file(), which is now part of Drupal 7 core. This allows FileField to manage files across revisions and translations with ease.

The ImageField Widget

ImageField is now completely dependent on FileField for its data handling. This means less duplicated, less bugs, and more compatibility between add-on modules. If an add-on module works for FileField, it automatically works for ImageField. This means that ImageField is now purely a "widget" for CCK, not a "field" any more.

Setting up a new Image field is now based on the "File" field type.

 

Uploading an image is just the same as FileField, only an image thumbnail is shown in the preview.

For Developers...

Devel Generate

FileField now has full support for Devel Generate, so you can populate an entire image gallery with a single click. FileField respects minimum and maximum image sizes during content creation, with randomly generated images.

Generated content with populated file and image fields.

Hook file support

Other modules can use FileField's hook_file() implementation to help determine when and where a file is in use. This means modules like the new FileField Sources module can reuse existing images on multiple nodes, even use IMCE to browse existing images and reuse them (as long as the files are assigned an FID in the database).

Using FileField Sources or other to-be made modules, reuse existing images or files on multiple nodes.

An Extensive Public API

FileField contains some super-handy API functions that let you easily grab files or nodes from the database based on limited information:

  • filefield_get_field_list() - Get a list of file (or image) fields within a node type.
  • filefield_get_file_reference_count() - Count how many times a file is in use.
  • filefield_get_file_references() - Get a list of all nodes that use a particular file.
  • filefield_get_node_files() - Get a list of all files that are attached to a node within one or all fields.
  • Plus hook file and all the goodness it brings.

And other goodies

The long development cycle of ImageField and FileField didn't deter people from building on the alpha and beta versions, a lot of cool project have appeared to build on the flexibility of these modules.

The stabilization of these modules means even more projects will build on them in the future. With a final version done for Drupal 6, it's time to look forward to Drupal 7 and make FileField join its friends: CCK in core, ImageAPI in core, and ImageCache in core.

Comments on this post will automatically be closed three months from the original post date.

Comments

Hallelujah!

And congratulations. For the first time in memory there's no immediate client need for this but I'll be looking for excuses to install and play with it right away.

benjamin, Agaric Design Collective

generate!

I'm so pleased to see full support for devel_generate. Nice one!

My clients will be so pleased to have a proper image module. Thanks.

There's my F*@#in Image!!!

The subject line says it all... looking forward to giving it a whirl... Thanks.

whoo

Nate! Nate! Nate! Nate!
dibs on dopry's eyebrows.

Side note

Also, I finally shut down FileField Image for good. The current usage count for FileField Image seems surprisingly high (597), but with the low number of people that are actually using FileField 6.x-1.x-beta3 (30, and that's the only compatible released version) it's more likely that people just have this module lying around doing nothing. It's just a plain hook that just doesn't get invoked if no module uses it.

Excellent, thanks Jakob

Ironically ImageField is now essentially exactly what FileField Image was, conceptually at least, now that it's just a pure widget for FileField. If you get some free time (ha!) you're always welcome to hop back into action with any new ideas. :D

Nearly, but not exactly

FileField Image was indeed a widget like ImageField now is (*good job!*) with one exception:

Through the "suitability" stuff (and configuration), FileField selected its widgets and formatters on the fly, which means you could have a regular file and an image in the same multi-value field and the widgets/formatters would adjust to the mimetype.

It would be great to have that kind of "meta" stuff for the new FileField as well, although when I get back in a few weeks then (apart from my usual Version Control API push onto d.o) I might rather work on FileField-in-core, Field-Tool-in-core (maybe), and of course making Transformations rock for the end user. That should probably be enough for two remaining months, won't get more than that done :P

under "other goodies" links

under "other goodies" links to the last two modules are incorrectly linked to lullabot.com.

Otherwise, WOOT!

Josh

Thanks, fixed. :-)

Thanks, fixed. :-)

Amazing work. Thanks so

Amazing work. Thanks so much, Nate.
Looking forward to core filefield ;-)

Excellent

Thanks for all of you hard work Nate & crew! Love the new features especially the progress bar. The topic came up in our user group on why we still using the "throbber" and not a progress bar... problem solved.

oooh - looks great

I'm constantly moaning about image and video handling in Drupal.. switching through various modules like Acidfree, thickbox, lightbox, blah blah blah but never finding a nice simple image handler with text.

I will be giving FileField and ImageField v3 a whirl later today...

double thumbs up

I'm afraid you might be

I'm afraid you might be expecting too much out of these - most of the modules you list work with filefield/imagefield to do their fancier displays, although imagefield has been usable for "old fashioned" galleries for a couple years now. My drupal5 recipe for image galleries used imagefield and viewfield (and imagecache, custom pagers, fivestar, etc) on a couple content types. Acidfree is overkill, but thickbox, etc., might be for you if you want overlaid galleries or such.

Amazing....

Amazing work guys, I love this module its fantastic. Great to have such great image manipulation tools.

Now I want to learn more about the API and see what it can really do! :)

Congratulations!

Congratulations! This looks very good. I hope this will help the convergence of image/multimedia handling in Drupal.

Added to DrupalSightings.com

Tip: How to enable PECL uploadprogress extention in MAMP

Great Work! Based on the excellent article "how to Setup a Memcached-Enabled MAMP Sandbox Environment" have I put together http://smbjorklund.no/how-enable-pecl-uploadprogress-extention-mamp

Cheers!
Stein Magne

Installation Instructions for PECL uploadprogress Extension

I just did a quick blog post on how to install the PECL extension. Hope it's of use to someone:

Installing PECL uploadprogress Extension for Drupal FileField 3.0 Module

Thanks!!

Congrats!!!

Thank you Lullabot!

I think FileField Sources might just save my life on my current project. It's the only sensible and near-complete way of sharing File/ImageField files I've seen. Assets looks abandoned, Media looks great but has a long way to go - FileField Sources looks *perfect*. Nice work! =)

(Oh, and the other stuff is pretty cool too.)