Skip to content

Commit

Permalink
Make files readable on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kneath committed Jun 6, 2008
1 parent 76a5a4b commit 9576f73
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/campaign.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def save_to_storage
FileUtils.mkdir_p(Merb.root / "public" / "advertisements")
FileUtils.rm(Merb.root / "public" + self.filename) if File.exists?(Merb.root / "public" + self.filename) unless self.filename.nil?
FileUtils.mv(tempfile_path, Merb.root / "public" + destination_path)
FileUtils.chmod 0666, Merb.root / "public" + destination_path
# update the record
self.filename = destination_path
self.save
Expand Down

0 comments on commit 9576f73

Please sign in to comment.