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
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 GitHub - thoughtbot/paperclip: Easy file attachment management for ActiveRecord
It is very easy to use and allows to upload files.
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
Max
@thanks max please can u suggest me any sample code.