Mr. Black
Mr. Black

Reputation: 12082

download the file from outside of the ruby on rails project

I have a files in my server the following location. "/home/files/*.doc". My Project location is "/home/bld/.." Is there way to download the doc file from the folder "/home/files/x.doc" using the ruby code. The documents folder is located from outside of my project folder,

Upvotes: 0

Views: 215

Answers (2)

fl00r
fl00r

Reputation: 83680

You don't need to download it while it is on the same computer. You need to copy it

Dir['/home/files/*.doc'].each do |file|
  File.cp file, "/home/bld/public/my_docs" # /home/bld/public/my_docs can be any dir
end

Upvotes: 0

Yule
Yule

Reputation: 9764

Shouldn't be an issue simply doing:

send_file('/home/files/*.doc')

No?

Upvotes: 1

Related Questions