Hi all,

I'm having an odd problem in uploading a file where the result of:

FileUpload upload = uploadField.getFileUpload();

is always null. I can't see what I've done wrong.


Here's part of my onSubmit method which works for textfields, but not fileuploads. It's a normal fileupload by the way (so its not an AJAX issue):

        
public void onSubmit(){
                                
        if (uploadField != null) {
                System.out.println("1 - uploadField not null");
                FileUpload upload = uploadField.getFileUpload();
                if(upload != null) {
                        System.out.println("2 - upload not null");
                        byte[] photoBytes = upload.getBytes();
                }
        }
                                
}

where uploadField is defined in the class like so:
private FileUploadField uploadField;

and then added to the form:
uploadField = new FileUploadField("picture");
form.add(uploadField);

        
So the form works as expected for textfields but not fileuploads. Can anyone spot any issues/give me pointers? The form is multipart encoded.


thanks.





Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to