sendfile - Rails, Download from BLOB database -


I have a problem, I save my upload data in the database file in the Blob file.

Now I want to download it ..

How to manage

I have tried this way (document_file is an area with blob data)

send_file @attachment .document_file ,: Nature =>

Thanks

Maybe you send_data for blob data instead of send_file Should use:

  send_data @ attachment.document_file ,: disposition = & gt; 'Attachment'   

Consider that the 'Attachment' is the default value, so you can leave it because you should get this error because send_file needs the file path as the argument, no That no blob

You can also see:

Comments