Store a personal file.

  1. <?php
  2. # Store a personal file for a user.
  3.  
  4. if (!defined('PHORUM')) return;
  5.  
  6. require_once("./include/api/base.php");
  7. require_once("./include/api/file_storage.php");
  8.  
  9. $file = array(
  10. "filename" => "myfile.ext", // the name of the file
  11. "filesize" => 2048, // the size of the file in bytes
  12. "file_data" => $file_data, // the contents of the file
  13. "link" => PHORUM_LINK_USER
  14. );
  15.  
  16. if (!phorum_api_file_check_write_access($file) ||
  17. !phorum_api_file_store($file)) {
  18. die("Storing the file failed. The error was: " . phorum_api_strerror());
  19. }
  20. ?>

Documentation generated on Tue, 31 Jul 2007 15:27:16 -0500 by phpDocumentor 1.3.0RC5