diff --git a/src/common/requests/upload.cr b/src/common/requests/upload.cr index eff012f..bacfe0a 100644 --- a/src/common/requests/upload.cr +++ b/src/common/requests/upload.cr @@ -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 diff --git a/src/server/storage.cr b/src/server/storage.cr index 602e5a0..626a5e4 100644 --- a/src/server/storage.cr +++ b/src/server/storage.cr @@ -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