dtrusty-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org
2008-Oct-05 02:49 UTC
Internet Explorer and Windows Media Player cause double send_file downloads?
Hi, Our Rails application allows WAV file downloads. The user clicks on a link, or clicks a button, and the WAV file gets sent as a response, using send_file. It looks like IE is discarding the initial WAV file and passing the URL to Windows Media Player. Windows Media Player then re-requests the file!! In addition to the performance problems, this design problem causes failures in the case of the download being initiated from a POST, since the re-request from the Media Player is only a GET, not a POST. How do I prevent this re-request? Thanks, David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mohit Sindhwani
2008-Oct-05 02:59 UTC
Re: Internet Explorer and Windows Media Player cause double send_file downloads?
dtrusty-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org wrote:> Hi, > > Our Rails application allows WAV file downloads. The user clicks on a > link, or > clicks a button, and the WAV file gets sent as a response, using > send_file. > > It looks like IE is discarding the initial WAV file and passing the > URL to Windows > Media Player. Windows Media Player then re-requests the file!! > > In addition to the performance problems, this design problem causes > failures in the > case of the download being initiated from a POST, since the re-request > from the > Media Player is only a GET, not a POST. > > How do I prevent this re-request? >I have found that the way that works for me (I use this for PNG) is to serve it up with the mime type ''application/unknown'' so that IE does not try to interpret what program should handle the information coming down. Cheers, Mohit. 10/5/2008 | 10:59 AM. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Oct-06 19:15 UTC
Re: Internet Explorer and Windows Media Player cause double send_file downloads?
> Our Rails application allows WAV file downloads. The user clicks on a > link, or > clicks a button, and the WAV file gets sent as a response, using > send_file. > > It looks like IE is discarding the initial WAV file and passing the > URL to Windows > Media Player. Windows Media Player then re-requests the file!! > > In addition to the performance problems, this design problem causes > failures in the > case of the download being initiated from a POST, since the re-request > from the > Media Player is only a GET, not a POST. > > How do I prevent this re-request?I don''t think you can. Years ago a collegue had an issue with large PDF''s being sent as a result of a POST. The PDFs that were under 1meg IE would download and then give that file to Adobe. Above 1meg and it would download some if it, then pass it to Adobe -- losing all the POST variables in the process. The only solution we found was to convert that POST into a GET (or redirect it to a temp url that is a get). And suffer with the re- sending. This was probably 6 years ago though... but sounds like it hasn''t changed one bit. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mohit Sindhwani
2008-Oct-07 05:13 UTC
Re: Internet Explorer and Windows Media Player cause double send_file downloads?
Philip Hallstrom wrote:>> Our Rails application allows WAV file downloads. The user clicks on a >> link, or >> clicks a button, and the WAV file gets sent as a response, using >> send_file. >> >> It looks like IE is discarding the initial WAV file and passing the >> URL to Windows >> Media Player. Windows Media Player then re-requests the file!! >> >> In addition to the performance problems, this design problem causes >> failures in the >> case of the download being initiated from a POST, since the re-request >> from the >> Media Player is only a GET, not a POST. >> >> How do I prevent this re-request? >> > > I don''t think you can. Years ago a collegue had an issue with large > PDF''s being sent as a result of a POST. The PDFs that were under 1meg > IE would download and then give that file to Adobe. Above 1meg and it > would download some if it, then pass it to Adobe -- losing all the > POST variables in the process. > > The only solution we found was to convert that POST into a GET (or > redirect it to a temp url that is a get). And suffer with the re- > sending. > > This was probably 6 years ago though... but sounds like it hasn''t > changed one bit. >I had a similar problem that a dynamically generated PNG was re-requested when a user right clicks and does a ''save'' (both in FF and IE). There was a GET request triggered after the initial POST that generated the image. We got around this by setting the mime type to application/unknown for the content. That way, IE and FF do not try to decode the content and do not try to ''support'' it through plugins, external programs, etc. I think it just asks to save the file. I think I replied this in an earlier mail. But, either way, hope this helps. Cheers, Mohit. 10/7/2008 | 1:13 PM. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mohit Sindhwani
2008-Oct-07 16:57 UTC
Re: Internet Explorer and Windows Media Player cause double send_file downloads?
dtrusty-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org wrote:> On Oct 4, 9:59 pm, Mohit Sindhwani <mo_m...-RxrYI66vbj0AvxtiuMwx3w@public.gmane.org> wrote: > >> dtru...-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org wrote: >> >>> Hi, >>> >>> Our Rails application allows WAV file downloads. The user clicks on a >>> link, or >>> clicks a button, and the WAV file gets sent as a response, using >>> send_file. >>> >>> It looks like IE is discarding the initial WAV file and passing the >>> URL to Windows >>> Media Player. Windows Media Player then re-requests the file!! >>> >>> In addition to the performance problems, this design problem causes >>> failures in the >>> case of the download being initiated from a POST, since the re-request >>> from the >>> Media Player is only a GET, not a POST. >>> >>> How do I prevent this re-request? >>> >> I have found that the way that works for me (I use this for PNG) is to >> serve it up with the mime type ''application/unknown'' so that IE does not >> try to interpret what program should handle the information coming down. >> >> Cheers, >> Mohit. >> 10/5/2008 | 10:59 AM. >> > > > I tried setting the ''type'' to ''application/unknown''. > > The problem persists. The Windows Media Player re-requests the file, > using an http GET request. > > Any ideas?Does it work in Firefox? Does it show that the MIME type is unknown? Sorry, I''m out of ideas for now in that case. Hopefully someone else can help. Cheers, Mohit. 10/8/2008 | 12:56 AM. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---