From 743a614a3a1e479ed0481f70483474d5835e5ec6 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 5 Feb 2008 03:54:12 +0000 Subject: [PATCH] change file permissioons to work with web server git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@139 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/models/image.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/image.rb b/app/models/image.rb index 0a2b1a9..2f15263 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -70,6 +70,7 @@ class Image < ActiveRecord::Base Dir.mkdir(base_directory) unless File.exist?(base_directory) self.original = File.basename(@file.original_filename).gsub(/[^\w._-]/, '') @magick_image.write("#{base_directory}/#{self.original}") + File.chmod(0644, "#{base_directory}/#{self.original}") @magick_image.thumbnail("600x600>") self.screen = "screen_#{self.original}" @magick_image.write("#{base_directory}/#{self.screen}") @@ -77,9 +78,11 @@ class Image < ActiveRecord::Base self.screen_width = $1 self.screen_height = $2 end + File.chmod(0644, "#{base_directory}/#{self.screen}") @magick_image.thumbnail("50x50>") self.thumbnail = "thumbnail_#{self.original}" @magick_image.write("#{base_directory}/#{self.thumbnail}") + File.chmod(0644, "#{base_directory}/#{self.thumbnail}") self.save end