Filefield

Published March 27, 2009
Provides a file upload CCK fieldtype with powerful features that go above and beyond Drupal's core upload capabilities.

This module is a CCK add-on that allows your content administrators to easily attach files to various content types. Its configuration allows you to dictate where each file gets stored on a per-user basis. It is required for many image-related CCK add-ons.

It provides many additional features above and beyond Drupal's core upload capabilities, including configurable per-user or per-field upload paths, configurable per-field size limits, and configuable per-field filetypes. It also has an API that allows module developers to leverage into its functionality.

The FileField module is required when using ImageField, a popular and extremely powerful way to add images to nodes.

Stats

SETTING: A television studio stage, complete with a fake kitchen set and a couple of generic PCs on the counter. Phil, a haggard-looking developer seems exasperated as he works at one of the PCs. Billy enters from the left to a modest round of applause from the studio audience.

BILLY: Hey Phil, what's got you down?

PHIL: Oh, hey Billy, I didn't see you come in. It's this darn core upload module, it's just not doing enough!

BILLY: (winking to the audience) Hmmm, tell me what you're trying to accomplish.

PHIL: Well, I've got this rocking Drupal 6 site with lots of users. One of the things users can do on my site is upload photos of themselves relaxing in their Snuggies and drinking some juice made with their Power Juicer.

BILLY: Wow - what a great idea! Have you ever considered having users upload photos of cleaning products?

PHIL: Uh...no, actually I haven't. Anyway, I have so many users uploading photos that navigating my Files directory is a complete nightmare. There must be a better way!

BILLY: Do you also wish that you can limit the size of the photos your users upload depending on the content type?

PHIL: As a matter of fact, I do!

BILLY: How about filetypes? Do you have a need to configure what types of files can be uploaded depending on the content type?

PHIL: Wow - you must be reading my mind!

BILLY: (Sensing a sale, he feels himself starting to get on a roll.) But wait, there's more - have you ever wanted to write your own file upload widget that automatically tries to extract the user's location from the photos's exif data so you can go to their house in the middle of the night and try to sell them a hair trimmer?

PHIL: Uh...no. Not really.

BILLY: Are you sure? Because if you did, there's probably a module out there with a robust enough API to do it.

PHIL: Yeah, pretty sure. You're kind of starting to creep me out.

Awkward silence

BILLY: Awww, I'm just messing with you! What you need is the FileField module!

PHIL: The FileField module? What does that do?

BILLY: Pretty much everything you've ever wanted a CCK file handling module to do.

PHIL: (dreamily) Wow, really?

BILLY: Absolutely. It's got your configurable per-user or per-field file upload paths so that your Files directory isn't just a huge, single-level pile of files. It even integrates with the Token module to let you customize the directory names.

PHIL: (beaming) Really? It's like it's too good to be true!

BILLY: It's also configurable on a per-field basis to limit the filetypes that can be uploaded as well as the maximum file size.

PHIL: Cool, that's amazing!

BILLY: You bet it's amazing. Plus, it also has a super-duper API to help you track down your users if they're silly enough to uplaod photos with exif location data.

PHIL: (looks worried again) Uh...yeah...right. Still not interested in that. (trying to smile) But I guess I'm glad to know that it's possible!

BILLY: Phil, how much do you think all this functionality costs?

PHIL: Hmmm, for all that, it can't be cheap...I'd say $39.99.

BILLY: Did I mention it has user-friendly AJAX uploads and integrates completely with CCK?

Audience applause

PHIL: No, you didn't! Wow! Make it $49.99!

BILLY: Don't forget about the Views integration!

More audience applause, a few cheers

PHIL: Really? Wow!

BILLY: How about full support for node revisions? Did I mention that? Did I? Did I?

Even more audience applause, people cheering

PHIL: Holy cow, no you didn't mention that! Wow, this thing must cost a fortune! How about $99.99?

BILLY: Let me tell you Phil...

Audience quickly settles down to listen

BILLY: It's less than $99.99.

PHIL: Wow, really?

Audience "ooooooos"

BILLY: It's not even $49.99.

PHIL: No way!

BILLY: It's not even $19.99.

PHIL: Now you're just messing with me!

BILLY: For a limited time, if you call in the next 10 minutes, it costs only $9.99!

Audience cheers, giving high-fives to each other

PHIL: $9.99! Wow? Really!? Isn't it open-source? Shouldn't it be free?

Audience goes silent immediately - everyone stares at Billy

BILLY: Yeah, I'm just messing with you! It's free! It's free! It's free for everyone! Go and download it today! For free!

Audience goes berzerk! Men and women are weeping with joy, children are dancing, Phil passes out from all the excitement.

END SCENE