how to upload and download files (type of files pdfs,xls,word)

47 views
Skip to first unread message

mack gille

unread,
Jul 9, 2013, 4:54:41 AM7/9/13
to rubyonra...@googlegroups.com
Hi,
I need to upload files in my rails application.the type of the files
should be pdf,xls,word.After that i need to download them from the view
page.plz help me in this regard.
Thankyou

--
Posted via http://www.ruby-forum.com/.

William Herry

unread,
Jul 9, 2013, 5:13:05 AM7/9/13
to rubyonra...@googlegroups.com
On Tue, Jul 9, 2013 at 4:54 PM, mack gille <li...@ruby-forum.com> wrote:
Hi,
  I need to upload files in my rails application.the type of the files
should be pdf,xls,word.After that i need to download them from the view
page.plz help me in this regard.
   Thankyou


You should look at Paperclip gem https://github.com/thoughtbot/paperclip

It is very easy to use and allows to upload files.​​

Max

unread,
Jul 9, 2013, 6:13:53 PM7/9/13
to rubyonra...@googlegroups.com
paperclip is a great way to upload the files.  downloading the files shouldn't be too difficult although the details can be specific to where you have your site deployed and how the file system is managed by the upload choices.

on one site i have some static files that the users need to download.  these are not uploaded content so i can just put them in /public/docs and create a link to them on the page.  the browser just knows to download them when a user clicks on the links.

from the sounds of it you'll probably want to create a model entry for each file that is uploaded, upload them to AWS or something like that and make those links point to the AWS instance of the file.  I imagine that would work.

good luck,

Max

mack gille

unread,
Jul 10, 2013, 4:46:15 AM7/10/13
to rubyonra...@googlegroups.com
> Max

@thanks max
please can u suggest me any sample code.
Reply all
Reply to author
Forward
0 new messages