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

.MultipartStream$MalformedStreamException: Stream ended unexpectedly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 1.3.1
    • None
    • httpclient

    Description

      When uploading files using the browser,it does not happen.But when submission using tools with 'multipart/form-data',for example httpclient,advanced rest client and so on,
      Only submit a text field, file field is empty, it will report the following exception:

      org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
      at org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:540)
      at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1038)
      at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)
      at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)
      at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

      A simple analysis that, when using the browser, file is not selected, the default browser will join the empty data file-part.
      But the use of tools such as httpclient, when the file is empty, it do not contain the documents data.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zhumingu zhumingu
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: