I am having the worst time figuring this out and I haven't found a solution close to what I need anywhere online.
We are using EJB, 11g and ADF to create a system where the user can download an xml file and all images pertaining to the xml file in one, clean zip package by clicking a button/link. The download must appear as a standard "Open, Save, Cancel" user prompt ( CUSTOMERS REQUEST)
I created the xml, I can pull the images from the SQL DB and I believe they are being input into my instance of ZipOutputStream, but the problem is returning the ZipOutputStream. The system plays friendly returning ByteArrayOutputStream pdfs, docs and images so I wanted to return the zip file the same way.
With our faces-config.xml, I cannot return values exactly how I need to. I have to go through response and context.
Below is where the files are pulled and stored in the ZipOutputStream...
And this is where it is returned as a request...
Note where the bytearray needs to be. Is this possible?
I don't understand why you are writing your zipped data to a FileOutputStream. That isn't what you want. And I don't understand why you ask how to write your zipped data to a byte array, either, because that isn't what you want. You want to write your zipped data to the response's output stream, don't you? If that's what you are saying, then just do this:
Joined: Apr 29, 2011
I'm not understanding that solution. I need the. exact inverse of that.
I don't know what you mean by "the exact inverse of that".
What I posted sends the zipped data to the response's output stream. I can't imagine what an "exact inverse" of that process would be. But anyway, your response suggests that you didn't want to send the zipped data to the response's output stream. I was under the impression that was your requirement.
But apparently it isn't. So how about a description of your requirement? What do you propose to do with that zipped data?