Forum OpenACS Q&A: Re: Extracting file-storage objects from the file system

Collapse
Posted by Dave Bauer on
You can reconstruct the filename from the database and a Tcl proc. So you could create a list of all the full file paths.

Something like this:

set root_folder [fs::get_root_folder -package_id $package_id]
set path [cr_fs_path $storage_area_key]
db_multirow file_paths get_paths "select content_item__get_path(ci.item_id) as file_storage_path, :path || cr.content as file_system_path from cr_items ci, cr_revisions cr where ci.content_type='file_storage_object' and ci.live_revision=cr.revision_id"]

then you should have the pretty path that file storage displays along with the actual path in the filesystem where the file lives.

You'd need to run that for each instance of file storage.