title: "Prefix too short" error when using JakartaStreamMultiPartRequest with empty file upload field
body: <p>I am using Struts 2.3.24.1 and after switching to the <code>jakarta-stream</code> implementation because of the bug mentioned <a href="https://stackoverflow.com/questions/18085359/struts2-file-upload-loosing-parameters">here</a>, I discovered a new error when the file upload field in my form is empty.
  My form looks like this (abridged):</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;s:form enctype="multipart/form-data" method="POST" action="persistAddNote" id="noteForm"&gt;
      &lt;s:token/&gt;
      &lt;s:file name="fileUpload" size="79"/&gt;
      &lt;s:if test="hasActionErrors()"&gt;
          &lt;s:property value="%{#request.uploadError}" escape="false"/&gt;
      &lt;/s:if&gt;
      &lt;s:submit cssClass="buttonFormat" value="Save"
                onclick="javascript: disableButtons(); document.noteForm.submit();"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>The <code>persistAddNote</code> action is configured as follows:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;action name="persistAddNote" class="my.example.action.PersistNoteAction"&gt;
      &lt;param name="parameter"&gt;my.example.encoder.Latin1ToLatin9Encoder&lt;/param&gt;
      &lt;interceptor-ref name="tokenSession"/&gt;
      &lt;interceptor-ref name="fileUpload"/&gt;
      &lt;interceptor-ref name="servletConfig"/&gt;
      &lt;interceptor-ref name="staticParams"/&gt;
      &lt;interceptor-ref name="actionMappingParams"/&gt;
      &lt;interceptor-ref name="params"/&gt;
      &lt;interceptor-ref name="validation"&gt;
          &lt;param name="excludeMethods"&gt;input,back,cancel,browse&lt;/param&gt;
      &lt;/interceptor-ref&gt; 
      &lt;interceptor-ref name="workflow"&gt;
          &lt;param name="excludeMethods"&gt;input,back,cancel,browse&lt;/param&gt;
      &lt;/interceptor-ref&gt;
      &lt;exception-mapping name="notes.error.filesize"
                         exception="my.example.exception.UploadFileSizeException"
                         result="/notes/error.jsp"/&gt;
      &lt;result name="input"&gt;/notes/addnote.jsp&lt;/result&gt;
      &lt;result name="added"&gt;/notes/newnoteok.jsp&lt;/result&gt;
      &lt;result name="novalidaction"&gt;/notes/noValidActionError.jsp&lt;/result&gt;
  &lt;/action&gt;  
  </code></pre>
  
  <p>The error occurs in the <code>JakartaStreamMultiPartRequest.createTemporaryFile(String, String)</code> method because no filename is set. This is to be expected since the file upload field is not required. I tried debugging the Struts code but it looks as if the <code>multipart/form-data</code> enctype always triggers the creation of a temporary file. The error is gone when I switch back to the standard <code>jakarta</code> implementation in the <code>struts.properties</code> but that brings back the issue I mentioned above.</p>
  
  <p>Does anyone have an idea how to fix this issue?</p>