[
https://issues.apache.org/jira/browse/FILEUPLOAD-299?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Senthur Rajakumar updated FILEUPLOAD-299:
-----------------------------------------
Description:
FileItem.write throws FileExistsException
(org.apache.commons.io.FileExistsException) when we try to re-upload (or
overwrite) a file.
*What works in v1.3.3:*
# User tries to upload a file user1.png
# It is stored in the server at c:\data\avatar\user1.png using FileItem.write
# User tries to upload the same file user1.png
# FileItem.write replaces the file c:\data\avatar\user1.png in the server with
the new file
*In v1.4:*
Step 4 fails with an exception - org.apache.commons.io.FileExistsException
*Stack Trace:*
org.apache.commons.io.FileExistsException: Destination
'c:\data\avatar\user1.png' already exists
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:3001)
at
org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
was:
FileItem.write throws FileExistsException
(org.apache.commons.io.FileExistsException) when we try to re-upload (or
overwrite) a file.
*What works in v1.3.3:*
# User tries to upload a file user1.png
# It is stored in the server at c:\data\avatar\user1.png using FileItem.write
# User tries to upload the same file user1.png
# FileItem.write replaces the file c:\data\avatar\user1.png in the server with
the new file.
*In v1.4:*
Step 4 fails with an exception - org.apache.commons.io.FileExistsException
*Stack Trace:*
org.apache.commons.io.FileExistsException: Destination
'c:\data\avatar\user1.png' already exists
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:3001)
at
org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
> Error replacing an existing file using FileItem.write
> -----------------------------------------------------
>
> Key: FILEUPLOAD-299
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-299
> Project: Commons FileUpload
> Issue Type: Bug
> Affects Versions: 1.4
> Reporter: Senthur Rajakumar
> Priority: Major
>
> FileItem.write throws FileExistsException
> (org.apache.commons.io.FileExistsException) when we try to re-upload (or
> overwrite) a file.
> *What works in v1.3.3:*
> # User tries to upload a file user1.png
> # It is stored in the server at c:\data\avatar\user1.png using FileItem.write
> # User tries to upload the same file user1.png
> # FileItem.write replaces the file c:\data\avatar\user1.png in the server
> with the new file
> *In v1.4:*
> Step 4 fails with an exception - org.apache.commons.io.FileExistsException
>
> *Stack Trace:*
> org.apache.commons.io.FileExistsException: Destination
> 'c:\data\avatar\user1.png' already exists
> at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:3001)
> at
> org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)