You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2014/11/12 12:55:34 UTC

[jira] [Commented] (FILEUPLOAD-193) FileNotFoundException thrown by DiskFileItem.write

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

Thomas Neidhart commented on FILEUPLOAD-193:
--------------------------------------------

One reason for this to happen could be that the file is stored in memory, thus the temporary file location is non-existant.

Analyzing the code, I can not see how this could happen, but can you please attach the source-code of your servlet handling the upload?

> FileNotFoundException thrown by DiskFileItem.write
> --------------------------------------------------
>
>                 Key: FILEUPLOAD-193
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-193
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>         Environment: Ubuntu 10.10
> java version "1.6.0_24"
> Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
> Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
>            Reporter: Dan Washusen
>            Priority: Critical
>
> Under certain conditions the DiskFileItem.write throws a FileNotFound exception.  It seems to be when outputFile.renameTo(file) fails.
> {code}java.io.FileNotFoundException: /tmp/UploadController/uploading/upload_69651d04_13000a31964__8000_00001651.tmp (No such file or directory)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(FileInputStream.java:106)
>         at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:447)
>         at upload.UploadController.handle(UploadController.java:90)
>         ...{code}
> I can't see any obvious reason why the source file (outputFile) wouldn't exist...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)