Commit 981eab2e authored by Valéry Tschopp's avatar Valéry Tschopp

upload key empty

parent b81ff98b
......@@ -42,7 +42,8 @@ end
post "/upload" do
#TODO Forward to error message if upload failed
key = params['file'][:filename]
s3.put_object({bucket: S3_BUCKET_NAME, key: key, body: params['file'][:tempfile].read})
if not key.empty?
s3.put_object({bucket: S3_BUCKET_NAME, key: key, body: params['file'][:tempfile].read})
redirect to('/')
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment