You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/08/22 12:14:00 UTC

[jira] [Commented] (FILEUPLOAD-348) DiskFileItem.write() behavior is inconsistent if the file exists

    [ https://issues.apache.org/jira/browse/FILEUPLOAD-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17582939#comment-17582939 ] 

Gary D. Gregory commented on FILEUPLOAD-348:
--------------------------------------------

Hi [~doublep] 

Would you check to see what happens in 2.0.0-SNAPSHOT? If anything changes it would most likely only be for 2.0.0, due to our limited time resources.

See [https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-fileupload2/2.0-SNAPSHOT/]

 

> 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)