fileupload_execute

Versions
4.7
fileupload_execute(&$node)

Implementation of hook_execute().

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

Code

developer/examples/fileupload.module, line 171

<?php
function fileupload_execute(&$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.