mirror of
https://github.com/mistergibson/gxg-server.git
synced 2026-10-19 06:59:44 -07:00
Added download_file
This commit is contained in:
parent
8f87624185
commit
46a8aaddfb
3 changed files with 93 additions and 20 deletions
|
|
@ -113,7 +113,13 @@ class Node0 < Sinatra::Application
|
|||
# end
|
||||
# ### Implementation of the verbs:
|
||||
get '*' do
|
||||
GxG::SERVICES[:www][:receiver].handle_request(:get, request, session)
|
||||
response = GxG::SERVICES[:www][:receiver].handle_request(:get, request, session)
|
||||
if response[0] == -255
|
||||
send_file(response[2][:result][:file], {:disposition => 'attachment', :filename => File.basename(response[2][:result][:file])})
|
||||
GxG::SERVICES[:core][:resources].destroy(response[2][:result][:vfs_dir], ::GxG::DB[:administrator])
|
||||
response = [200, {"content-type" => "application/json"}, {:result => true}.to_json()]
|
||||
end
|
||||
response
|
||||
end
|
||||
#
|
||||
put '*' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue