From 5a990ff59177ff7d63f5217fefeddd2bd485b4d5 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Mon, 3 Jun 2013 20:57:15 -0700 Subject: [PATCH] Fix file perms --- app.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.rb b/app.rb index f00f4f2c..df309aba 100644 --- a/app.rb +++ b/app.rb @@ -132,7 +132,10 @@ post '/site_files/upload' do sanitized_filename = params[:newfile][:filename].gsub(/[^a-zA-Z_\-.]/, '') - FileUtils.mv params[:newfile][:tempfile].path, File.join(site_base_path(current_site.username), sanitized_filename) + dest_path = File.join(site_base_path(current_site.username), sanitized_filename) + FileUtils.mv params[:newfile][:tempfile].path, dest_path + File.chmod(0640, dest_path) if self.class.production? + flash[:success] = "Successfully uploaded file #{sanitized_filename}." redirect '/dashboard' end