0

What i need is the ability to download a file which is not stored in the database but in one of application folders. lets say that the path of this file might look like this:

application_name/log/important_resources/file.txt

In my app I want one place where this file can be downloaded. I tried

File.open(path)

but it fails to give me anything, literally just open the file and does nothing.

EDIT

Where i need this feature is one of the models

Leo
  • 2,061
  • 4
  • 30
  • 58

1 Answers1

0

You can use send_file in your controller action to send files to the client. documentation

Slicedpan
  • 4,995
  • 2
  • 18
  • 33