Hello everyone, How to give the functionality to choose a directory path to save a file by a user? Thanks in advance.... -- Posted via http://www.ruby-forum.com/.
On Nov 6, 12:34 am, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello everyone, > > How to give the functionality to choose a directory path to save a file > by a user? >Save a file where? On the server''s filesystem or the client''s? Not much info in this question... --Matt Jones
> Save a file where? On the server''s filesystem or the client''s? Not > much info in this question... > > --Matt JonesHi Matt, I want to save file at Client''s System. Thanks, Salil Gaikwad -- Posted via http://www.ruby-forum.com/.
On Nov 6, 11:07 pm, Salil Gaikwad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Save a file where? On the server''s filesystem or the client''s? Not > > much info in this question... > > > --Matt Jones > > Hi Matt, > > I want to save file at Client''s System. >The most reliable way to get a file to download every time (regardless of content type) is to send a Content-Disposition header set to ''attachment''. See this doc: http://support.microsoft.com/kb/260519 (on the MS KB, but the header works everywhere). --Matt Jones
Salil Gaikwad wrote:> >> Save a file where? On the server''s filesystem or the client''s? Not >> much info in this question... >> >> --Matt Jones > > > Hi Matt, > > I want to save file at Client''s System. > > Thanks, > > Salil GaikwadHi Salil, I think you want download file option. For example on hitting a URL you want user to download a zip file code for it you can do something like this - class MyController < ApplicationController def downloadzip send_file "path_to_file", :type=>"application/zip" end end Thanks -- Prasad http://roorky.com Interactive Programming Books -- Posted via http://www.ruby-forum.com/.