A website template with lots of features, built with ruby on rails.

upload.rb 525B

123456789101112131415161718192021222324252627
  1. class Upload < ActiveRecord::Base
  2. mount_uploader :file, FileUploader
  3. process_in_background :file
  4. def get_extension
  5. if(self.file_processing == false)
  6. case self.file.file.content_type
  7. when 'image/jpeg'
  8. return 'jpg'
  9. when 'image/png'
  10. return 'png'
  11. when 'image/gif'
  12. return 'gif'
  13. when 'application/pdf'
  14. return 'pdf'
  15. else
  16. return 'none'
  17. end
  18. else
  19. return 'none'
  20. end
  21. end
  22. end