# Store a personal file.

1. <?php
2. # Store a personal file for a user.
4. if (!defined('PHORUM')) return;
6. require_once("./include/api/base.php");
7. require_once("./include/api/file_storage.php");
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. );
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 Wed, 17 Mar 2010 01:45:25 -0500 by phpDocumentor 1.4.1