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