#attribute is listed as one of the attributes a file element can have. It is listed in the Form API Reference
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/forms_api_reference.html#file
so we should have it implemented. Here is a patch that does just that.

CommentFileSizeAuthor
attributes_for_file.patch1.12 KBvhmauery
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

What do you need this for?

vhmauery’s picture

Acidfree uses a nice little piece of javascript that sets the title field of the node (if it is empty) when the filename changes.

That and ALL the items should have #attributes per the documentation. The real question is why not. Leaving it out really limits the possibilities of file fields.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD.

Dries’s picture

Status: Fixed » Closed (fixed)