Overview
Who should use it.
Features.
What it doesn't do.
Who should use it
This module is for developers who are building or modifying a form using Drupal's form API and are handling files that are stored natively using Drupal's core file management functionality.
It is not a CCK widget, Filefield is an excellent equivalent for CCK. The core upload module provides similar functionality on node forms.
Do not install this module unless you are a developer, an interested party, or directed to do so by another module.
Features
Both elements share the following core features.
- AHAH upload support.
- Themable preview fields for the filename and image.
- Maintains state with validation errors.
- Works with public and private file system settings.
- Works with and without clean URL support.
- Temporary storage is based on the form build id, so multiple instances of the same form do not interact with each other.
- Users get notifications about files that exceed the PHP based size limitations1.
- Accepts validators to pass to file_save_upload. Image and max file size validators are added directly when applicable.
- The required attribute works!
The image upload element has built in imagecache support when saving the newly uploaded file from the temp directory to it's permanent location. You also get control of the image preview size.
1 This excludes forms submitted using the main submit button that exceed the max post size. PHP drops the entire $_POST element, so Drupal will render a complete new form rather than an error on the original form.
What it doesn't do
It is simply designed to upload a file into Drupal's file directory with a record in Drupals {files} table.
- This module does not provide functionality for presenting uploaded files or images.
- It does not provide a
hook_file_downloadfor private file downloads. - It does not provide automated submit to save new files or to replace existing files.
- It does not set the forms enctype. This patch should take care of this in core soon.
It also relies on Drupal's core file system handling to delete temporary files. As such, CRON must be enabled.