fileupload_insert

Versions
4.6 – 5
fileupload_insert($node)

Implementation of hook_insert().

The node is being created, save the file's infomation to the database.

Code

developer/examples/fileupload.module, line 203

<?php
function fileupload_insert($node) {
  $file = $node->file;
  db_query("INSERT INTO {fileupload} (nid, filename, filepath, filemime, filesize) VALUES (%d, '%s', '%s', '%s', %d)", $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
}
?>
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.