How do you access the raw content of a file uploaded with Paperclip / Ruby on Rails?

后端 未结 6 1771
误落风尘
误落风尘 2020-12-05 07:24

I\'m using Paperclip / S3 for file uploading. I upload text-like files (not .txt, but they are essentially a .txt). In a show controller, I want to be able to get the cont

6条回答
  •  抹茶落季
    2020-12-05 07:26

    To access the file you can use the path method: csv_file.path http://rdoc.info/gems/paperclip/Paperclip/Attachment#path-instance_method

    This can be used along with for example the CSV reader.

提交回复
热议问题