diff --git a/app/models/resource.rb b/app/models/resource.rb
index <HASH>..<HASH> 100644
--- a/app/models/resource.rb
+++ b/app/models/resource.rb
@@ -9,6 +9,8 @@ class Resource < ActiveRecord::Base
   
   def write_to_disk(up)
     begin
+      # create the public/files dir if it doesn't exist
+      FileUtils.mkdir(fullpath('')) unless File.directory?(fullpath(''))
       if up.kind_of?(Tempfile) and !up.local_path.nil? and File.exist?(up.local_path)
         File.chmod(0600, up.local_path)
         FileUtils.copy(up.local_path, fullpath)
Fix resource upload when dir doesn't exist.  (closes #<I>)

git-svn-id: <URL>