* multipart response possible with Rack?
@ 2010-04-19 9:05 Michael Franzl
2010-04-20 6:34 ` Konstantin Haase
0 siblings, 1 reply; 4+ messages in thread
From: Michael Franzl @ 2010-04-19 9:05 UTC (permalink / raw)
To: rack-devel
I would like to generate a multipart HTTP response to a conventional
GET request. For the end user, this will display a web page and
download a file simultaneously. The response should look like the
example below.
Can I do this with Rack?
Thanks,
Michael
HTTP/1.1 200/OK
Content-type: multipart/mixed; boundary=xyz
Content-Description: multipart-1
--xyz
Content-Type: text/plain
Content-Disposition: inline
Content-Description: text-part-1
Some text goes here.
--xyz
Content-Type: application/vnd.print
Content-Disposition: inline; filename=invoice.bon
Content-Description: invoice-part-2
This is text inside of a file.
--xyz--
--
Subscription settings: http://groups.google.com/group/rack-devel/subscribe?hl=en
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multipart response possible with Rack?
2010-04-19 9:05 multipart response possible with Rack? Michael Franzl
@ 2010-04-20 6:34 ` Konstantin Haase
2010-04-20 7:00 ` Michael Franzl
0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Haase @ 2010-04-20 6:34 UTC (permalink / raw)
To: rack-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Apr 19, 2010, at 11:05 , Michael Franzl wrote:
> I would like to generate a multipart HTTP response to a conventional GET request. For the end user, this will display a web page and download a file simultaneously. The response should look like the example below.
>
> Can I do this with Rack?
I don't think there is a middleware or some sort of helper right now.
You could try something like this: http://gist.github.com/372122
By the way: Do browsers support that?
Konstantin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
iQEcBAEBAgAGBQJLzUrtAAoJEM+qkfuqK1IX+4MIALgNm9stV0lLVXCMNekcGiaW
v4ahVMIWwP4o6ugVzeFATd5Qj4+UyZPZ+QyLDGGxFL9+GZ403+/GC18963rxcBY6
D+r76/Nu6024yXE/ydLQzOypLs2tVE1aIFNfTJ7CRxLl9jxHlIxYeHYhSUdGLELj
hqyFPTfsErADvVey2+boYuRH9v+zUSGSSBrUSqS+xx84p0zP53gTojibmOtrEP6o
dTUnP9VAOuBLxjGS0jLwfkvE0HjxbCIq/+JFT4lsnlWY13T/O4dp6ZHn97ZbzyP/
ADTMVtxI9olJ/3JftB5ySdeu8soa0NRpEW0+SsqXUw8yWJoq2n07eXshiq0GjrM=
=N6G4
-----END PGP SIGNATURE-----
--
Subscription settings: http://groups.google.com/group/rack-devel/subscribe?hl=en
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multipart response possible with Rack?
2010-04-20 6:34 ` Konstantin Haase
@ 2010-04-20 7:00 ` Michael Franzl
2010-04-20 7:17 ` Konstantin Haase
0 siblings, 1 reply; 4+ messages in thread
From: Michael Franzl @ 2010-04-20 7:00 UTC (permalink / raw)
To: rack-devel
Konstantin Haase wrote:
> I don't think there is a middleware or some sort of helper right now.
> You could try something like this: http://gist.github.com/372122
Thanks for the hint. So I could write a custom Rack middleware to
support that? And I could access this middleware from Rails? Is this
more or less easy to do? Sorry, I am a newcomer to Rack, but I am be
ready to learn it.
> By the way: Do browsers support that?
I tried it, Firefox does. When I remember correctly, IE doesn't.
Michael
--
Subscription settings: http://groups.google.com/group/rack-devel/subscribe?hl=en
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: multipart response possible with Rack?
2010-04-20 7:00 ` Michael Franzl
@ 2010-04-20 7:17 ` Konstantin Haase
0 siblings, 0 replies; 4+ messages in thread
From: Konstantin Haase @ 2010-04-20 7:17 UTC (permalink / raw)
To: rack-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Apr 20, 2010, at 09:00 , Michael Franzl wrote:
> Konstantin Haase wrote:
>> I don't think there is a middleware or some sort of helper right now.
>> You could try something like this: http://gist.github.com/372122
>
> Thanks for the hint. So I could write a custom Rack middleware to support that? And I could access this middleware from Rails? Is this more or less easy to do? Sorry, I am a newcomer to Rack, but I am be ready to learn it.
I think doing this as a middleware would be possible without violating the rack spec (but abusing it). Dunno how to integrate that in Rails.
Konstantin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
iQEcBAEBAgAGBQJLzVUVAAoJEM+qkfuqK1IXqtwH/3u7Y4WyeekZAhjDjc6lyONG
1rRd9sbpzimTUHv3QScz8RUxK0/cWXyM6UGH92laiIZXvrnh2Ri8q2TwJ7618rm2
7y6ZCIqay5FKMlUjFbZtQhXWuLrW+VAhDRYWpwssfr9sos9rR+gjiIoL3nqRv3gs
bTwqAWCltVzPqwkHAgGJdQqKU9la0m4uVAudR94EArSjmVdpzl3d0p2pDH4iXeNu
aQ9sDPcX3WednDLCbhmMlia+Xz8xggSU1n2uXomeqK6GO02wLPVEiaQv7tgMuGUt
I8v+KyhSeInx6EESu0G8R/WFGtTlmAmoFbW0+9ZzH/AoPOFZsBrxfdBZaNFxew0=
=uKQu
-----END PGP SIGNATURE-----
--
Subscription settings: http://groups.google.com/group/rack-devel/subscribe?hl=en
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-20 7:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 9:05 multipart response possible with Rack? Michael Franzl
2010-04-20 6:34 ` Konstantin Haase
2010-04-20 7:00 ` Michael Franzl
2010-04-20 7:17 ` Konstantin Haase
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).