cr_create_content_file (public)
cr_create_content_file [ -move ] item_id revision_id client_filename
Defined in packages/acs-content-repository/tcl/content-procs.tcl
Copies the file passed by client_filename to the content repository file storage area, and it returns the relative file path from the root of the content repository file storage area.. if the -move flag is given the file is renamed instead
- Switches:
- -move (optional, boolean)
- Parameters:
- item_id (required)
- revision_id (required)
- client_filename (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xotcl_core_tutorial_4, test_cr_items
Source code: # # A malicious user may try to sneak a symlink in the content # repository, for instance, via a zip file upload. We want to # prevent this. # file lstat $client_filename file_info if {$file_info(type) eq "link"} { error "Attempt to store a symlink in the content repository!" } set content_file [cr_create_content_file_path $item_id $revision_id] set dir [cr_fs_path] if { $move_p } { file rename -- $client_filename $dir$content_file } else { file copy -force -- $client_filename $dir$content_file } cr_add_to_file_creation_log $content_file return $content_fileXQL Not present: Generic, PostgreSQL, Oracle