# Downloading a file from a remote server?

**URL:** <https://www.ruby-forum.com/t/downloading-a-file-from-a-remote-server/184783>\
**Category:** Rails\
**Created:** [March 8, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/downloading-a-file-from-a-remote-server/184783 "2010-03-08T17:05:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [March 8, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/downloading-a-file-from-a-remote-server/184783/1 "2010-03-08T17:05:35Z")

</div>

I am using the Paperclip plugin to store video attachments into a  
remote server (via an ftp storage module written by Damian Caruso) it  
works well…  
Now I would like my web app user to be able to download back this  
attachment into their local pc

I can use

def download  
…  
Net::SCP.start( hostname, username, :password =\> password ) do|  
scp|  
scp.download!(‘httpdocs/video-library/clips/requests/46/  
CraigStadler.mp4’, ‘/tmp’)  
end  
… which download the file first in the /tmp folder of my web app,  
then doing a sendfile…

but is there any other solution ( direct link to remote server is not  
a solution… )

thanks for your help

Yves
