Index: openacs-4/packages/file-storage/www/download-zip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/download-zip.tcl,v diff -u -r1.9.2.12 -r1.9.2.13 --- openacs-4/packages/file-storage/www/download-zip.tcl 21 Jun 2021 08:59:48 -0000 1.9.2.12 +++ openacs-4/packages/file-storage/www/download-zip.tcl 9 Sep 2021 14:03:58 -0000 1.9.2.13 @@ -59,7 +59,11 @@ set n $download_name set f $out_file set u $user_id - set file_url [export_vars -base ./download-zip-2 { + # The download URL always points to the file-storage instance of + # the file, unlike the return_url, which might be arbitrary. + set package_id [fs::get_file_package_id -file_id $object_name_id] + set package_url [site_node::get_url_from_object_id -object_id $package_id] + set file_url [export_vars -base ${package_url}/download-zip-2 { f:sign(max_age=300) n:sign(max_age=300) u:sign(max_age=300) @@ -72,6 +76,12 @@ -html \ -message $message + if {$return_url eq ""} { + # Return URL must be not-empty or we will redirect to + # ourselves... + set return_url $package_url + } + ad_progress_bar_end \ -url $return_url Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u -r1.61.2.11 -r1.61.2.12 --- openacs-4/packages/file-storage/www/folder-chunk.tcl 7 Jun 2021 14:19:19 -0000 1.61.2.11 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 9 Sep 2021 14:03:58 -0000 1.61.2.12 @@ -27,6 +27,8 @@ page_num } +set this_page [ad_return_url] + set viewing_user_id [ad_conn user_id] permission::require_permission -party_id $viewing_user_id -object_id $folder_id -privilege "read" @@ -226,8 +228,9 @@ [_ file-storage.Delete] ${fs_url}delete [_ file-storage.Delete_Checked_Items] } + set zip_url [export_vars -base ${fs_url}download-zip {{return_url $this_page}}] lappend bulk_actions \ - [_ file-storage.Download_ZIP] ${fs_url}download-zip [_ file-storage.Download_ZIP_Checked_Items] + [_ file-storage.Download_ZIP] $zip_url [_ file-storage.Download_ZIP_Checked_Items] callback fs::folder_chunk::add_bulk_actions \ -bulk_variable "bulk_actions" \ @@ -368,7 +371,7 @@ set alt_icon #file-storage.folder# set file_url [export_vars -base "${fs_url}index" {{folder_id $object_id}}] set download_link [_ file-storage.Download] - set download_url "[export_vars -base "${fs_url}download-zip" -url {object_id}]" + set download_url [export_vars -base "${fs_url}download-zip" -url {object_id {return_url $this_page}}] } url { set properties_link [_ file-storage.properties] @@ -470,7 +473,7 @@ } if {$content_size_total > 0} { - set compressed_url [export_vars -base ${fs_url}download-zip -url {{object_id $folder_id}}] + set compressed_url [export_vars -base ${fs_url}download-zip -url {{object_id $folder_id} {return_url $this_page}}] } # Local variables: