mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-17 02:03:15 +09:00
bug #2641: Handle error on the server side when uploading a file
This commit is contained in:
1 parent
4bbfe0fd29
commit
c92cdebacd
1 file changed
+7
-2
@@ -423,10 +423,15 @@ post '/upload'do
|
||||
tmpfile.flush
|
||||
else
|
||||
logger.error { "Unexpected rackinput class #{rackinput.class}" }
|
||||
return [500, ""]
|
||||
[500, ""]
|
||||
end
|
||||
|
||||
@SunstoneServer.upload(params[:img], tmpfile.path)
|
||||
if tmpfile.size == 0
|
||||
[500, OpenNebula::Error.new("There was a problem uploading the file, " \
|
||||
"please check the permissions on the file").to_json]
|
||||
else
|
||||
@SunstoneServer.upload(params[:img], tmpfile.path)
|
||||
end
|
||||
end
|
||||
|
||||
##############################################################################
|
||||
|
||||
Reference in new issue
Block a user