Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mms.process do |media_type, files|
- # go through each file
- files.each do |filename|
- # if it's a format we support, create a record
- if media_type =~ /pdf/ # just pdfs for now, to reduce confusion
- File.open(filename) do |tempfile|
- # Somewhere in here I'd like to change filename.content_type
- # to the proper type using mimetype-fu
- # except doing tempfile.content_type = whatever doesn't seem to work.
- thing = Thing.new
- thing.document = tempfile
- thing.save!
- end
- end
- end
- end
- thing.document_content_type = whatever
Add Comment
Please, Sign In to add comment