fileupload_submit

Versions
5
fileupload_submit(&$node)

Implementation of hook_submit().

If a file was uploaded save it before updating the database.

Code

developer/examples/fileupload.module, line 179

<?php
function fileupload_submit(&$node) {
  // if a file was uploaded, move it to the files directory
  if ($file = file_check_upload('file')) {
    $node->file = file_save_upload($file, file_directory_path(), false);
  }
}
?>
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.