summaryrefslogtreecommitdiff
path: root/app/uploaders/generic_file_uploader.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-11 10:51:28 +0200
committerPeter Kozak <spag@golwen.net>2013-04-11 10:51:28 +0200
commit78ea4bcd397a4d8f39ad3c08066fe918a8fc89ad (patch)
treea22d63d7fcaa2c2c32d2905424777a1ff1a8a21d /app/uploaders/generic_file_uploader.rb
parent145d774adece71282020603b699ab684537cc1b3 (diff)
file uploader
Diffstat (limited to 'app/uploaders/generic_file_uploader.rb')
-rw-r--r--app/uploaders/generic_file_uploader.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/uploaders/generic_file_uploader.rb b/app/uploaders/generic_file_uploader.rb
new file mode 100644
index 0000000..4a226ed
--- /dev/null
+++ b/app/uploaders/generic_file_uploader.rb
@@ -0,0 +1,18 @@
+# encoding: utf-8
+
+class GenericFileUploader < CarrierWave::Uploader::Base
+
+ storage :file
+
+ def store_dir
+ model.store_dir
+ end
+
+ def cache_dir
+ '/tmp/generic_file_uploader'
+ end
+
+ def extension_white_list
+ %w(pdf ps jpg jpeg gif png tif tiff wav mp3)
+ end
+end