Hi,
i am coding a contrubute module /custom cck field. But i am stuck at the point where i want my files to be uploaded to a folder outside the public html folder. I want them to be for example in /var/files. It does not work because the working directory is still the sites/default/files dir (checked that with getcwd() ), even if i pass /var/files to file_move (to move them out of the temp dir).
I read the sourcode of a module that does save its files outside the public html, it uses something like:
global $conf;
$system_directory_path = $conf['file_directory_path'];
$system_file_downloads = $conf['file_downloads'];
$mymodule_directory_path = variable_get('mymodule_private_directory_path', $system_directory_path);
$mymodule_file_downloads = FILE_DOWNLOADS_PRIVATE;
...... operations and code and then sets the paths back.
$conf['file_directory_path'] = $system_directory_path;
$conf['file_downloads'] = $system_file_downloads;
I think that does not look very clean. Is there another way without manipulating the global $conf at runtime of the module?
any ideas?
thank you
marco