Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest-fs-openacs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-rest-fs-openacs
Commits
656168c5
Commit
656168c5
authored
Dec 11, 2018
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added tests for Salo
parent
fd8b22f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
download.tcl
www/download.tcl
+28
-0
No files found.
www/download.tcl
View file @
656168c5
...
@@ -17,6 +17,11 @@ if {"" eq $file_id && "" ne $version_id} {
...
@@ -17,6 +17,11 @@ if {"" eq $file_id && "" ne $version_id} {
set file_id
[
db_string cr_item
"select item_id from cr_revisions where revision_id = :version_id"
-default
""
]
set file_id
[
db_string cr_item
"select item_id from cr_revisions where revision_id = :version_id"
-default
""
]
}
}
if
{
""
eq
$version
_id &&
""
ne
$file
_id
}
{
set version_id
[
content::item::get_live_revision -item_id
$file
_id
]
}
# Get the paths
# Get the paths
set
revision_id
$version
_id
set
revision_id
$version
_id
set
the_root
$::acs::pageroot
set
the_root
$::acs::pageroot
...
@@ -27,6 +32,29 @@ set template_root [db_string template_root "select content_template__get_root_fo
...
@@ -27,6 +32,29 @@ set template_root [db_string template_root "select content_template__get_root_fo
set
user_id
[
ad_conn user_id
]
set
user_id
[
ad_conn user_id
]
set
storage_area_key
"CR_FILES"
set
path
[
cr_fs_path
$storage
_area_key
]
set
filename
[
db_string filename
"select :path || content from cr_revisions where revision_id = :version_id"
]
set
binary_content
""
if
{[
catch
{
set fl
[
open
$filename
]
fconfigure
$fl
-encoding binary
set binary_content
[
read
$fl
]
close
$fl
}
err
]}
{
ad_return_complaint 1
"Unable to open file
$wordcount
_file:<br><pre>
\n
$err
</pre>"
ad_script_abort
}
ad_return_complaint 1
"
$path
-
$filename
- len=
[
string
length
$binary
_content
]
- sha1=
[
ns_sha1
$binary
_content
]
"
# Serve the page
# Serve the page
# DRB: Note that content::init modifies the local variable the_root, which is treated
# DRB: Note that content::init modifies the local variable the_root, which is treated
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment