Topic: paperclip and file download

Hi all,

I am trying to add file attachment funtionality to my application, my requriement is a user should be able to upload any type of file ( xls, doc, zip etc) and later on by clicking on the attached file link should be able to download the file

1. I thought paperclip plugin will meet this requriment, but now I am not sure and seek your help
2. I was successfully able to install and configure the plugin

the issue I have is
1. How do we donwload a file that is been uploaded
2. how do I show just the name of the attachment instead of thumb nail etc

Please advise if I could do this with paperclip or some other plugin thank you

amit

Re: paperclip and file download

1. link_to "Download", model.whatever.url(:original, false)

2. model.attachment_file_name

Re: paperclip and file download

Thank you so much it works like a charm.. the only issue I have is that it opens the attachment in the browser itself rather then as txt file or xls file or pdf file .. could you advise bit on that how I can achieve the next level .. Thank you again for taking time out to reply to my questions.

Re: paperclip and file download

That's a content type / header problem with your http browser.

Re: paperclip and file download

Thanks i've been searching for this.

Re: paperclip and file download

Can I get a verification that the .url method is actually a paperclip object method?

I'm calling it on what I believe to be a paperclip object .. without any luck.

Re: paperclip and file download

Thanks Johnson I was searching for the same information. Your information help me.

Thanks

Re: paperclip and file download

Thanks! Helped me too!