diff options
-rw-r--r-- | lib/active_file/sites/disk_site.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/active_file/sites/disk_site.rb b/lib/active_file/sites/disk_site.rb index 2bf80d07f4..d61b6c3c5d 100644 --- a/lib/active_file/sites/disk_site.rb +++ b/lib/active_file/sites/disk_site.rb @@ -8,6 +8,7 @@ class ActiveFile::Sites::DiskSite < ActiveFile::Site @root = root end + def upload(key, data) File.open(make_path_for(key), "wb") do |file| while chunk = data.read(65536) @@ -45,6 +46,7 @@ class ActiveFile::Sites::DiskSite < ActiveFile::Site Digest::MD5.file(path_for(key)).hexdigest end + private def path_for(key) File.join root, folder_for(key), key |