This works by adding inputStream = new FileInputStream(filename); at the end of encryption.
On Mon, Sep 15, 2014 at 9:18 PM, Sunanda Rani <[email protected]> wrote: > Thanks,. Another quick help needed on the same > My application is strut2 so, I generate inputstream in action class and > pass inputstream and filename to struts2. > I will not have the file as such in action class. How do I protect xlsx in > this scenario. I can't use the code mentioned earlier as it expects the > file to be present. > my struts.xml sample > > <action name="download" class="com.developer.am.action.DownloadAction"> > <result name="success" type="stream"> > <param name="contentType"> > application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</param> > <param name="inputName">fileInputStream</param> > <param name="contentDisposition">attachment;filename="${filename}"</param> > <param name="bufferSize">1024</param> > </result> > </action> > > Thanks > > On Mon, Sep 15, 2014 at 8:50 PM, kiwiwings [via Apache POI] < > [email protected]> wrote: > >> Nandu wrote >> It worked when I used POIFSFileSystem fs = new POIFSFileSystem(); >> Earlier i tried using NPOIFSFileSystem which was throwing error. >> Thanks a lot for immediate help. >> >> There were a few fixes in version 3.11-beta1 (around #56437, which I've >> tested with encryption). >> What happens when you are using a recent POI version + NPOIFS? >> (I'll try it tonight again with the trunk and NPOIFS ...) >> >> ------------------------------ >> If you reply to this email, your message will be added to the >> discussion below: >> >> http://apache-poi.1045710.n5.nabble.com/Encrypt-xlsx-file-with-POI3-9-tp5716609p5716627.html >> To unsubscribe from Encrypt xlsx file with POI3.9, click here >> <http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716609&code=c3VuYW5kYS5yYW5pQGdtYWlsLmNvbXw1NzE2NjA5fDE2NzE5OTY3NDU=> >> . >> NAML >> <http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >> > > -- View this message in context: http://apache-poi.1045710.n5.nabble.com/Encrypt-xlsx-file-with-POI3-9-tp5716609p5716634.html Sent from the POI - User mailing list archive at Nabble.com.
