# -*- tcl -*- # # Redirect to download files by URL # enables WebDAV as well as just making it easier to download stuff # @author Dave Bauer (dave@thedesignexperience.org) # @creation-date 2003-10-19 # @cvs-id $Id: index.vuh,v 1.5.2.2 2016/06/09 09:13:26 gustafn Exp $ set full_uri [ad_conn url] set extra_uri [ad_conn path_info] set root_folder [fs_get_root_folder] set file_item_id [fs::get_item_id -name $extra_uri -folder_id $root_folder] ns_log debug "File Storage index.vuh item_id=$file_item_id URL=[ad_conn url]" if {$file_item_id eq ""} { ns_log debug "File Storage return not found" ns_return 404 text/plain "File Not Found" ad_script_abort } permission::require_permission \ -object_id $file_item_id \ -privilege read \ -party_id [ad_conn user_id] set file_live_revision [content::item::get_live_revision -item_id $file_item_id] if {[apm_package_installed_p views]} { views::record_view -object_id $file_item_id -viewer_id $user_id } cr_write_content -revision_id $file_live_revision # Local variables: # mode: tcl # tcl-indent-level: 4 # indent-tabs-mode: nil # End: