fileupload_form

Versions
4.6
fileupload_form(&$node, &$error, &$param)
4.7 – 5
fileupload_form(&$node)

Code

developer/examples/fileupload.module, line 71

<?php
function fileupload_form(&$node, &$error, &$param) {
  // Set form parameters so we can accept file uploads.
  $param['options'] = array('enctype' => 'multipart/form-data');

  $output = form_file(t('File'), 'file', 40, ($error['file'] ? theme('error', $error['file']) : t('A file already exists, if you upload another file the current file will be replaced.')));

  if ($node->nid) {
    $output .= form_hidden('filepath', $node->filepath);
  }

  return $output;
}
?>
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.