Skip to content

StandardMultipartFile.transferTo should fall back to manual copy if Part.write doesn't support absolute locations (e.g. on Jetty) [SPR-15257] #19822

@spring-projects-issues

Description

@spring-projects-issues

Aleš Laňar opened SPR-15257 and commented

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.


Affects: 4.2.6

Issue Links:

Referenced from: commits 2233ec0, b73153c

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions