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

yangshulin edited comment on FILEUPLOAD-338 at 6/26/21, 1:00 AM:
-----------------------------------------------------------------

Sorry, I don't know how to unit test FileUpload.

Below is the critical crash stack:

java.io.IOException: Failed to delete original file 
'C:\Users\XX\AppData\Local\Temp\upload_69595089_ccd2_42e5_9be0_367b7e24bdc7_00000005.tmp'
 after copy to 
'C:\Users\XX\Documents\Web\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\medias\1624669113739.jpg'
 at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2578) at 
org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)

I think it is a bug of FileUtils.moveFile, this crash appears on FileUpload 
1.4, FileUpload 1.3 works well, because it uses IOUtils to copy streams.


was (Author: yang2021):
Sorry, I don't know how to unit test FileUpload.

Below is the critical crash stack:

org.apache.commons.io.FileExistsException: Destination 
'C:\Users\XX\Documents\Web\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\medias\1624668135089.jpg'
 already exists

at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2568)

at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)

I think it is a bug of FileUtils.moveFile, this crash appears on FileUpload 
1.4, FileUpload 1.3 works well, because it uses IOUtils to copy streams.

> FileItem.write crash on Windows Tomcat
> --------------------------------------
>
>                 Key: FILEUPLOAD-338
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-338
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: yangshulin
>            Priority: Critical
>
> When I use FileItem.write on FileUpload 1.4, it will crash on Windows Tomcat, 
> linux server has not been tested. I find it is crashed by FileUtils.moveFile, 
> which reports IO Exception. FileUpload 1.3 works well, because it use file 
> streams copying.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to