Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-76

[fileupload] Efficient upload stream reading API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • Operating System: other
      Platform: Other

    • 38623

    Description

      The current FileUpload API only allows uploaded data to be read by the
      application if an intermediate buffer (i.e. DiskFileItem) is used. It
      would be very handy if the low-level interfaces provided read access to
      the uploaded file data.

      Currently, the API provided by MultipartStream is in terms of an
      OutputStream,

      int readBodyData(OutputStream output)

      I am proposing the addition of a method like,

      InputStream readBodyData()

      This allows the data to be processed as it's uploaded in the common case that
      the API doing the processing is implemted in terms of an InputStream rather than
      an OutputStream (e.g. unzipping, parsing XML, etc).

      The use of a DiskFileItem (for instance) to get around the problem of stream
      direction results in processing only commencing once the whole upload is
      complete. For large uploads, this could well mean that the delay between
      uploading completing and server-size processing completing will be so long that
      (without additional hackery) the client will time-out waiting for the final
      response.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dave@badgers-in-foil.co.uk David Holroyd
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: