form_file

Versions
4.6
form_file($title, $name, $size, $description = NULL, $required = FALSE)

Format a file upload field.

For assistance with handling the uploaded file correctly, see the API provided by file.inc.

Parameters

$title The label for the file upload field.

$name The internal name used to refer to the field.

$size A measure of the visible size of the field (passed directly to HTML).

$description Explanatory text to display after the form item.

$required Whether the user must upload a file to the field.

Return value

A themed HTML string representing the field.

Related topics

▾ 5 functions call form_file()

fileupload_form in developer/examples/fileupload.module
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
upload_form in modules/upload.module
user_edit_form in modules/user.module
_locale_admin_import_screen in includes/locale.inc
User interface for the translation import screen

Code

includes/common.inc, line 1355

<?php
function form_file($title, $name, $size, $description = NULL, $required = FALSE) {
  return theme('form_element', $title, '<input type="file" class="'. _form_get_class('form-file', $required, _form_get_error($name)) .'" name="edit['. $name .']" id="edit-'. $name .'" size="'. $size ."\" />\n", $description, 'edit-'. $name, $required, _form_get_error($name));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.