Reputation: 12082
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
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
Reputation: 9764
Shouldn't be an issue simply doing:
send_file('/home/files/*.doc')
No?
Upvotes: 1