Well, maybe I missed saying it in typing.
Pipe the stream from the screen renderer to the zip compressor. Pipe the zip compressor's output
to the browser.
The screen renderer will need to be changed to allow the above. I'm hoping the zip compressor
allows streaming output, or we will have to
Maybe I missed something. It sounded like you were proposing sending the rendered screen directly to
the response's output stream. That wouldn't work because in the two file formats mentioned - xsl-fo
and zip - there needs to be an intermediate document that is parsed and converted.
-Adrian
Jo
Adrian,
The rest of my email (of which you quoted a part) highlighted how to rewire the
ScreenFopViewHandler to "output via stream without storing in large byte array". Yes, the way it
is done now can be improved on a lot. Some PDF screens do take quite a bit of memory.
Using that same method
Jonathon -- Improov wrote:
Why render to a temp file? Why not simply render to a byte array like
ScreenFopViewHandler (pdf) does? Temp files need cleaning up.
Because there is no way of knowing in advance how large the document will be. A good example is the
entity reference xsl-fo file I crea
hour day.
But if I can help or colaborate on anything, I'll find some time.
Skip
-Original Message-
From: Jonathon -- Improov [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 21, 2007 9:01 PM
To: user@ofbiz.apache.org
Subject: Re: Write to Browser
Skip,
If you're talk
Skip,
If you're talking about being retarded and working many projects for fun without money, then yes,
I'm worse than you. If it's just about being retarded, I think I'm in some hall of fame.
I've been watching your personality, Skip. Pardon me. Are you a techie? I bet you are great with
cus
"I'm feeling like I need a stretch, and may implement this just for fun."
Gads Jonathon, your are worse than me.
Skip
- Original Message
From: Adrian Crum <[EMAIL PROTECTED]>
To: user@ofbiz.apache.org
Sent: Wednesday, November 21, 2007 10:16:39 AM
Subject: Re: Write to Browser
You'll have to back up in the code some and see how the writer is being
used. If nothing has been written alread
additional flags to change whether .getWriter() or
getOutputStream() is used?
- Original Message
From: Adrian Crum <[EMAIL PROTECTED]>
To: user@ofbiz.apache.org
Sent: Wednesday, November 21, 2007 10:16:39 AM
Subject: Re: Write to Browser
You'll have to back up in the code
Handler or just additional flags to change whether .getWriter() or
getOutputStream() is used?
- Original Message
From: Adrian Crum <[EMAIL PROTECTED]>
To: user@ofbiz.apache.org
Sent: Wednesday, November 21, 2007 10:16:39 AM
Subject: Re: Write to Browser
You'll have to back up
Adrian Crum <[EMAIL PROTECTED]>
To: user@ofbiz.apache.org
Sent: Wednesday, November 21, 2007 9:45:47 AM
Subject: Re: Write to Browser
FileInputStream zipInStream = new FileInputStream(zipFile);
OutputStream browserOutStream = response.getOutputStream();
response.setContent
It won't let me do response.getOutputStream. I get an error that says
"getWriter() has already been called for this response"
- Original Message
From: Adrian Crum <[EMAIL PROTECTED]>
To: user@ofbiz.apache.org
Sent: Wednesday, November 21, 2007 9:45:47 AM
Subject:
FileInputStream zipInStream = new FileInputStream(zipFile);
OutputStream browserOutStream = response.getOutputStream();
response.setContentLength((int)zipFile.length());
response.setContentType("application/zip");
// Call a routine to copy bytes from zipInStream to browserOutStream
-Adrian
Chris
I'm trying to create a zip file on the fly. I've created it properly so that
it will write to the file system, but I would prefer to write to the browser so
that the user can download it. This seems like it should be so simple, but I'm
missing it. TIA for any help!
Chris
14 matches
Mail list logo