Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15257

StandardMultipartFile.transferTo should fall back to manual copy if Part.write doesn't support absolute locations (e.g. on Jetty)

    Details

    • Last commented by a User:
      false

      Description

      I found problem with `StandardMultipartHttpServletRequest.transferTo(File dest)`.
      This method calls write method with destination path of given file:

      @Override
      		public void transferTo(File dest) throws IOException, IllegalStateException {
      			this.part.write(dest.getPath());
      		}
      

      But if I'll check write method of jetty-util, it wants only String fileName and problem is in this part:

      //part data is only in the ByteArrayOutputStream and never been written to disk
                      _file = new File (_tmpDir, fileName);
      

      Result is that there is _tmpDir (path of file) concated with filename where is actually complete path, so path is duplicated.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                Hrabosch Aleš Laňar
                Last updater:
                Juergen Hoeller
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 38 weeks ago