From: Phillip Gawlowski Date: 2008-06-05T02:26:26+09:00 Subject: Re: download a file -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fredy wrote: | Hello | I have a file on the server and i want it to be downloadable by users | when they press on a link. i tried send_date, but it created a new | file instead of grabbing the existing one. | Here is the code | | def download | send_data( path=>"public/files/test.doc" , :filename => "test.doc", | :type => "text/doc", :disposition => "attachment") | end | | any help will be appreciated :) Is this Rails, Merb, or...? Anyway, if it is a framework, you might be better off asking the community around the framework for hints and help. ;) Anyway, if you are using Rails you could use link_to, for example, as described here: http://wiki.rubyonrails.org/rails/pages/HowToLinkToStaticFile Note: The code presented there could be vulnerable to code injection, so proceed with caution. - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Blog: http://justarubyist.blogspot.com ~ Verbing weirds language. ~ --- Calvin. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhG0IMACgkQbtAgaoJTgL/sxgCcDgq2BZj2c7p1cvT1nIBb+g0n EH0AnRtOJkQ+ac50aLeXgcrUyEIFeZyI =RAc7 -----END PGP SIGNATURE-----