From ffaa6b2ac372e01cbfe2d594e361ad0a096acb29 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jul 2013 23:12:00 +0200 Subject: [PATCH] how am i still getting empty files.. how --- app.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.rb b/app.rb index 56754b3a..f0eafcdc 100644 --- a/app.rb +++ b/app.rb @@ -260,10 +260,10 @@ post '/site_files/upload' do @errors = [] http_error_code = 406 -# if params[:newfile] == '' || params[:newfile].nil? -# @errors << 'You must select a file to upload.' -# halt http_error_code, slim(:'site_files/new') -# end + if params[:newfile] == '' || params[:newfile].nil? + @errors << 'You must select a file to upload.' + halt http_error_code, 'Did not receive file upload.' # slim(:'site_files/new') + end if params[:newfile][:tempfile].size > Site::MAX_SPACE || (params[:newfile][:tempfile].size + current_site.total_space) > Site::MAX_SPACE @errors << 'File size must be smaller than available space.'