[
https://issues.apache.org/jira/browse/FILEUPLOAD-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18067513#comment-18067513
]
Gary D. Gregory commented on FILEUPLOAD-348:
--------------------------------------------
Hello [~doublep]
Please check the current versions of 1.x and 2.x where this looks to me to be
fixed.
TY!
> DiskFileItem.write() behavior is inconsistent if the file exists
> ----------------------------------------------------------------
>
> Key: FILEUPLOAD-348
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-348
> Project: Commons FileUpload
> Issue Type: Improvement
> Affects Versions: 1.4
> Reporter: Paul Pogonyshev
> Priority: Major
>
> Usecase: writing to a temporary file created with File.createTempFile(). The
> file returned by this method _already exists_ and is empty.
> If the contents of DiskFileItem is held in memory (i.e. is small), call to
> DiskFileItem.write() succeeds. If it is written to the disk (i.e. is not
> small), DiskFileItem.write() calls FileUtis.moveFile() which throws an
> exception, as the target file already exists.
> This is inconsistent both within the same method and also with the way 1.3.3
> used to behave (always succeed).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)