mirror of
https://github.com/mistergibson/gxg-server.git
synced 2026-08-15 10:24:29 -07:00
Testing Download
This commit is contained in:
parent
9cfb33642e
commit
70abafd659
1 changed files with 3 additions and 2 deletions
|
|
@ -1222,9 +1222,10 @@ module GxGwww
|
|||
cache_profile = (GxG::SERVICES[:core][:resources].entries(temp_dir, ::GxG::DB[:administrator]) || []).first
|
||||
if cache_profile
|
||||
handle = GxG::SERVICES[:core][:resources].open((temp_dir + "/" + cache_profile[:title]), ::GxG::DB[:administrator])
|
||||
download_path = handle[:resource].path()
|
||||
# download_path = handle[:resource].path()
|
||||
response = [200, {"content-type" => "application/json"}, ({:result => true, :file_name => cache_profile[:title], :data => handle[:resource].read}).to_json()]
|
||||
GxG::SERVICES[:core][:resources].close(handle[:token])
|
||||
response = [-255, {"content-type" => "application/hash"}, {:result => {:file => download_path, :vfs_dir => temp_dir}}]
|
||||
# response = [-255, {"content-type" => "application/hash"}, {:result => {:file => download_path, :vfs_dir => temp_dir}}]
|
||||
else
|
||||
raise "Failed to get cache profile."
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue