Push final path of the uploaded file in Response::Upload.
parent
6bd194529b
commit
3c7a2eb8f7
|
@ -45,7 +45,8 @@ end
|
|||
class FileStorage::Response
|
||||
JSONIPC.request Upload, 20 do
|
||||
property mid : String
|
||||
def initialize(@mid)
|
||||
property path : String
|
||||
def initialize(@mid, @path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -112,9 +112,10 @@ class FileStorage::Storage
|
|||
# In this case: ignore the upload request
|
||||
end
|
||||
|
||||
FileStorage::Response::Upload.new request.mid
|
||||
path = "/files/#{user.uid}/#{request.file.digest}.bin"
|
||||
FileStorage::Response::Upload.new request.mid, path
|
||||
rescue e
|
||||
puts "Error handling transfer: #{e.message}"
|
||||
puts "Error handling upload: #{e.message}"
|
||||
FileStorage::Response::Error.new mid.not_nil!, "Unexpected error: #{e.message}"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue