Rakhi
2008-Apr-03 06:52 UTC
used send_data() for downloading xml file, How to ask location 4 the download
hello, i m tryin to save a xml file using send_data( out_data, :type => "text/xml", filename => "sample.xml" ) where "out_data" is the string instance that contains the generated XML, "text/xml" is the mime type to be set in the response, and "sample.xml" is the filename that will be presented to the client as the name of the file it attempts to download. Where i m stuck is , the sample.xml is getting downloaded on desktop. i want to ask the user to provide the location where he wants to download the "sample.xml". i also used browse button to ask location and then send that location to the filename parameter, in dat case the downloaded file is renamed as \...\location\..\sample.xml. and even then the file is saved on the desktop. plz help me solve this problem. ..thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-03 07:16 UTC
Re: used send_data() for downloading xml file, How to ask location 4 the download
Hi Pakhi, Unfortunately, the server has no control whatsoever over what the client application will do with the file. If your user is using Firefox, it will usually ask you what you want to do with it. If your users are using Safari, or Internet Explorer, it will usually simply save to the default location. Other browsers behave similarly. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO (#2) OUT NOW! http://sensei.zenunit.com/ On 03/04/2008, at 5:52 PM, Rakhi wrote:> > hello, > i m tryin to save a xml file using > > send_data( out_data, :type => "text/xml", filename => "sample.xml" ) > > where > > "out_data" is the string instance that contains the generated XML, > > "text/xml" is the mime type to be set in the response, and > > "sample.xml" is the filename that will be presented to the client as > the name of the > file it attempts to download. > > Where i m stuck is , the sample.xml is getting downloaded on desktop. > i want to ask the user to provide the location where he wants to > download the "sample.xml". > > i also used browse button to ask location and then send that location > to the filename parameter, in dat case the downloaded file is renamed > as \...\location\..\sample.xml. > and even then the file is saved on the desktop. > > plz help me solve this problem. ..thanks > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rakhi
2008-Apr-03 07:41 UTC
Re: used send_data() for downloading xml file, How to ask location 4 the download
Thanks 4 ur reply Julian. can i alter the download settings of a specific browser using javascript in the view code of my application? On Apr 3, 12:16 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote:> Hi Pakhi, > > Unfortunately, the server has no control whatsoever over what the > client application will do with the file. If your user is using > Firefox, it will usually ask you what you want to do with it. If your > users are using Safari, or Internet Explorer, it will usually simply > save to the default location. Other browsers behave similarly. > > Julian. > > Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO > (#2) OUT NOW!http://sensei.zenunit.com/ > > On 03/04/2008, at 5:52 PM, Rakhi wrote: > > > > > hello, > > i m tryin to save a xml file using > > > send_data( out_data, :type => "text/xml", filename => "sample.xml" ) > > > where > > > "out_data" is the string instance that contains the generated XML, > > > "text/xml" is the mime type to be set in the response, and > > > "sample.xml" is the filename that will be presented to the client as > > the name of the > > file it attempts to download. > > > Where i m stuck is , the sample.xml is getting downloaded on desktop. > > i want to ask the user to provide the location where he wants to > > download the "sample.xml". > > > i also used browse button to ask location and then send that location > > to the filename parameter, in dat case the downloaded file is renamed > > as \...\location\..\sample.xml. > > and even then the file is saved on the desktop. > > > plz help me solve this problem. ..thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-03 07:46 UTC
Re: used send_data() for downloading xml file, How to ask location 4 the download
Not that I know of. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO (#2) OUT NOW! http://sensei.zenunit.com/ On 03/04/2008, at 6:41 PM, Rakhi wrote:> > Thanks 4 ur reply Julian. > > can i alter the download settings of a specific browser using > javascript in the view code of my application? > > On Apr 3, 12:16 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: >> Hi Pakhi, >> >> Unfortunately, the server has no control whatsoever over what the >> client application will do with the file. If your user is using >> Firefox, it will usually ask you what you want to do with it. If your >> users are using Safari, or Internet Explorer, it will usually simply >> save to the default location. Other browsers behave similarly. >> >> Julian. >> >> Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO >> (#2) OUT NOW!http://sensei.zenunit.com/ >> >> On 03/04/2008, at 5:52 PM, Rakhi wrote: >> >> >> >>> hello, >>> i m tryin to save a xml file using >> >>> send_data( out_data, :type => "text/xml", filename => "sample.xml" ) >> >>> where >> >>> "out_data" is the string instance that contains the generated XML, >> >>> "text/xml" is the mime type to be set in the response, and >> >>> "sample.xml" is the filename that will be presented to the client as >>> the name of the >>> file it attempts to download. >> >>> Where i m stuck is , the sample.xml is getting downloaded on >>> desktop. >>> i want to ask the user to provide the location where he wants to >>> download the "sample.xml". >> >>> i also used browse button to ask location and then send that >>> location >>> to the filename parameter, in dat case the downloaded file is >>> renamed >>> as \...\location\..\sample.xml. >>> and even then the file is saved on the desktop. >> >>> plz help me solve this problem. ..thanks > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pardee, Roy
2008-Apr-08 01:31 UTC
Re: used send_data() for downloading xml file, How to ask location 4 the download
Isn''t there a ''content-disposition: attachment'' header thingy you can add to get browsers to pop a save-as dialog for the response? (Forgive my bad terminology--I''m not really ''webby''...) -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Julian Leviston Sent: Thursday, April 03, 2008 12:46 AM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: used send_data() for downloading xml file, How to ask location 4 the download Not that I know of. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO (#2) OUT NOW! http://sensei.zenunit.com/ On 03/04/2008, at 6:41 PM, Rakhi wrote:> > Thanks 4 ur reply Julian. > > can i alter the download settings of a specific browser using > javascript in the view code of my application? > > On Apr 3, 12:16 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: >> Hi Pakhi, >> >> Unfortunately, the server has no control whatsoever over what the >> client application will do with the file. If your user is using >> Firefox, it will usually ask you what you want to do with it. If your>> users are using Safari, or Internet Explorer, it will usually simply >> save to the default location. Other browsers behave similarly. >> >> Julian. >> >> Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO >> (#2) OUT NOW!http://sensei.zenunit.com/ >> >> On 03/04/2008, at 5:52 PM, Rakhi wrote: >> >> >> >>> hello, >>> i m tryin to save a xml file using >> >>> send_data( out_data, :type => "text/xml", filename => "sample.xml" ) >> >>> where >> >>> "out_data" is the string instance that contains the generated XML, >> >>> "text/xml" is the mime type to be set in the response, and >> >>> "sample.xml" is the filename that will be presented to the client as>>> the name of the file it attempts to download. >> >>> Where i m stuck is , the sample.xml is getting downloaded on >>> desktop. >>> i want to ask the user to provide the location where he wants to >>> download the "sample.xml". >> >>> i also used browse button to ask location and then send that >>> location to the filename parameter, in dat case the downloaded file >>> is renamed as \...\location\..\sample.xml. >>> and even then the file is saved on the desktop. >> >>> plz help me solve this problem. ..thanks > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2008-Apr-08 04:07 UTC
Re: used send_data() for downloading xml file, How to ask location 4 the download
It won''t do a save-as, but you can specify it should save it as a file rather than display inline. Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 08/04/2008, at 11:31 AM, Pardee, Roy wrote:> > Isn''t there a ''content-disposition: attachment'' header thingy you can > add to get browsers to pop a save-as dialog for the response? > > (Forgive my bad terminology--I''m not really ''webby''...) > > -----Original Message----- > From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Julian > Leviston > Sent: Thursday, April 03, 2008 12:46 AM > To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails] Re: used send_data() for downloading xml file, How to > ask location 4 the download > > > Not that I know of. > > Julian. > > > Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO > (#2) OUT NOW! > http://sensei.zenunit.com/ > > > On 03/04/2008, at 6:41 PM, Rakhi wrote: > >> >> Thanks 4 ur reply Julian. >> >> can i alter the download settings of a specific browser using >> javascript in the view code of my application? >> >> On Apr 3, 12:16 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: >>> Hi Pakhi, >>> >>> Unfortunately, the server has no control whatsoever over what the >>> client application will do with the file. If your user is using >>> Firefox, it will usually ask you what you want to do with it. If >>> your > >>> users are using Safari, or Internet Explorer, it will usually simply >>> save to the default location. Other browsers behave similarly. >>> >>> Julian. >>> >>> Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW >>> VIDEO >>> (#2) OUT NOW!http://sensei.zenunit.com/ >>> >>> On 03/04/2008, at 5:52 PM, Rakhi wrote: >>> >>> >>> >>>> hello, >>>> i m tryin to save a xml file using >>> >>>> send_data( out_data, :type => "text/xml", filename => >>>> "sample.xml" ) >>> >>>> where >>> >>>> "out_data" is the string instance that contains the generated XML, >>> >>>> "text/xml" is the mime type to be set in the response, and >>> >>>> "sample.xml" is the filename that will be presented to the client >>>> as > >>>> the name of the file it attempts to download. >>> >>>> Where i m stuck is , the sample.xml is getting downloaded on >>>> desktop. >>>> i want to ask the user to provide the location where he wants to >>>> download the "sample.xml". >>> >>>> i also used browse button to ask location and then send that >>>> location to the filename parameter, in dat case the downloaded file >>>> is renamed as \...\location\..\sample.xml. >>>> and even then the file is saved on the desktop. >>> >>>> plz help me solve this problem. ..thanks >>> > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---