title: Spark Java - strange behavior when uploading files
body: <p>In my project I want to try to upload files, here is the part of the code responsible for this:</p>
  <pre><code>        MultipartConfigElement multipartConfigElement =
                  new MultipartConfigElement(
                          &quot;/tmp_files&quot;,
                          avatarSize,
                          avatarSize,
                          1024
                  );
  
          request.raw().setAttribute(
                  &quot;org.eclipse.jetty.multipartConfig&quot;,
                  multipartConfigElement
          );
  
          Part uploadedFile = request.raw().getPart(&quot;file&quot;);
  
  </code></pre>
  <p>And a request to upload a file using Idea's http client:</p>
  <pre><code>POST http://localhost:8080/users/me/avatar
  Content-Type: multipart/form-data; boundary=abcd
  Authorization: Bearer {{authToken}}
  
  --abcd
  Content-Disposition: form-data; name=&quot;file&quot;; filename=&quot;test.png&quot;
  
  &lt; /Users/user1/resources/test.png
  --abcd--
  
  </code></pre>
  <p>where test.png is a regular picture.
  But when I try to load in this code place:</p>
  <pre><code>Part uploadedFile = request.raw().getPart(&quot;file&quot;);
  </code></pre>
  <p>I get an error:</p>
  <pre><code>java.nio.file.NoSuchFileException: /tmp_files/MultiPart11851484240893602177
      at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
      at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
      at java.base/java.nio.file.Files.newByteChannel(Files.java:375)
      at java.base/java.nio.file.Files.createFile(Files.java:652)
  
  </code></pre>
  <p>It can be assumed that this error is due to the fact that there are no write permissions to the root of the file system (I'm testing on mac os, under the user).
  But if i try to upload another file - which is just a zip file then everything works.</p>
  <pre><code>POST http://{{host}}/users/me/avatar
  Content-Type: multipart/form-data; boundary=abcd
  Authorization: Bearer {{authToken}}
  
  --abcd
  Content-Disposition: form-data; name=&quot;file&quot;; filename=&quot;file123.zip&quot;
  
  &lt; /Users/18493151/develop/icandev/api-gateway/src/main/resources/file123.zip
  --abcd--
  </code></pre>
  <p>and no exception in this line:</p>
  <pre><code>Part uploadedFile = request.raw().getPart(&quot;file&quot;);
  </code></pre>
  <p>Why is this happening? Why does the result depend on the file type?</p>
  <p>sparkjava version 2.9.4</p>