Commit e60cd75a authored by Valéry Tschopp's avatar Valéry Tschopp

check params for 'file'

parent f6d90bf1
......@@ -45,8 +45,8 @@ end
post "/upload" do
#TODO Forward to error message if upload failed
key = params['file'][:filename]
if not key.empty?
if params.key?('file')
key = params['file'][:filename]
s3.put_object({bucket: S3_BUCKET_NAME, key: key, body: params['file'][:tempfile].read})
end
redirect to('/')
......
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