Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<af:inputFile> not getting EOFException for large files

ross_cJul 26 2012 — edited Nov 4 2012
Hello,
Im using Jdev 11.1.1.4 and using an <af:inputFile> component to upload documents, this is all working fine as I can upload small documents and so whatever but I want to do some validation on large files (e.g. restrict file length). The spec says that I should get an EOF exception if the file size exceeds the default UPLOAD_MAX_DISK_SPACE size but I don't see anything.

The page just refreshes and the file isn't set in my bean. Some snippets of code:
<af:inputFile label="Document to upload:" value="#{myBean.uploadFile}" id="if1"/>
<af:commandButton text="Upload" action="#{myBean.doUpload}" id="cb1"/>

private UploadedFile uploadFile;

    public void setUploadFile(UploadedFile uploadFile) {
        this.uploadFile = uploadFile;
    }

    public UploadedFile getUploadFile() {
        return uploadFile;
    }

    public String doUpload(){
      //some stuff here
      return null;
    }
I'm debugging and setting breakpoints in the doUpload() and setUploadFile() methods but they aren't called if the file is too big and I don't see an exception. These breakpoints do halt when the file is small. I'm a bit confused, would have thought I would get an exception or at least see the file go into the bean...

Any ideas?

Cheers,
Ross
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2012
Added on Jul 26 2012
4 comments
501 views