You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/10/02 23:20:46 UTC

DO NOT REPLY [Bug 23580] New: - how to read uploaded FormFile InputStream multiple times?

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23580>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23580

how to read uploaded FormFile InputStream multiple times?

           Summary: how to read uploaded FormFile InputStream multiple
                    times?
           Product: Struts
           Version: 1.0 Final
          Platform: All
               URL: http://jakarta.apache.org/struts/api/org/apache/struts/u
                    pload/FormFile.html#getInputStream()
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: File Upload
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: hauser@acm.org
                CC: stefan.berger@softborg.com


This is a documentation enhancement request:

we use the html:file to upload also large attachments to a web-mail application.
First we put it into the database, but immediately thereafter, we would like to
send it off to multiple recipients via encrypted mail.

We get a "Bad File Descriptor" when trying to access the data for a second time
after putting it into the database.
doing a inputStream.reset() gives a "java.io.IOException: mark/reset not supported".
If we wipe the attachment from the session and get it from the (MySQL) database
again, reset() works beautifully. But going back and forth to the database is a
big waste if the InputStreams get large.

Therefore my request to enhance the documentation: how can one use such an
InputStream multiple times?

P.S.: We figured that Blobs coming from MySQL are actually ByteArrayInputStream
thus having a reset(). However, as we tried to convert data coming from struts
FormFile to ByteArrayInputStream, it got corrupted.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org