Re: Returning a response of unknown length using WOResponse.setContentStream()
Re: Returning a response of unknown length using WOResponse.setContentStream()
- Subject: Re: Returning a response of unknown length using WOResponse.setContentStream()
- From: Hugi Thordarson <email@hidden>
- Date: Fri, 29 Mar 2019 15:53:14 +0000
Hi Paul,
I can't offer any help at all, besides telling you that I fought the same issue
a while back and ended up defeated, writing the Zip file to a temp file and
returning that to the client.
However, if you do choose to pursue this perilous path, the statement
"WOHttpIO._alwaysAppendContentLength = false;" might be a tiny bit helpful. But
who knows what else *that* might flonk up.
If you figure this out, I'd love to hear about it.
- hugi
> On 28 Mar 2019, at 02:02, Paul Hoadley <email@hidden> wrote:
>
> Hello,
>
> I am zipping some files on the fly and trying to return the ZIP to the
> browser. (None of the files are on the appserver, including the resulting
> ZIP—it's all InputStreams and OutputStreams.) I can call
> WOResponse.setContentStream(), but it expects a contentSize argument. Setting
> this to, say 0, or some arbitrarily large number doesn't work. It certainly
> appears that the browser expects the correct value or no header. What I can't
> see is where "content-size" is even being set—as late as after
> WOApplication.dispatchRequest(), the WORequest doesn't seem to have a
> "content-size" header. If I knew where/when it was being set, I could
> presumably remove it.
>
> Has anyone solved any of these problems before? How can I return a response
> of unknown length to the browser?
>
>
> --
> Paul Hoadley
> https://logicsquad.net/
> https://www.linkedin.com/company/logic-squad/
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden