# packages/attachments/www/download/index.vuh ad_page_contract { Virtual URL handler for file downloads @author Ben Adida @creation-date 2 July 2002 @cvs-id $Id: index.vuh,v 1.3 2017/08/07 23:48:04 gustafn Exp $ } { object_id:naturalnum,notnull attachment_id:naturalnum,notnull } # Permission check permission::require_permission -object_id $object_id -privilege read # Get the live version # (and check that this is the right attachment while we're at it) set version_id [db_string select_version_id {} -default {}] if {$version_id eq ""} { ad_return_complaint "bad attachment" ad_script_abort return } cr_write_content -revision_id $version_id # Local variables: # mode: tcl # tcl-indent-level: 4 # indent-tabs-mode: nil # End: