Take a look over Section 11.7 "File upload" of the Wicket Guide:
http://wicket.apache.org/guide/guide/chapter11.html#chapter11_7

You need something like this:
fileUploadField = new FileUploadField("fileUploadField");
        Form form = new Form("form"){
                @Override
                protected void onSubmit() {
                  super.onSubmit();
                  FileUpload fileUpload = fileUploadField.getFileUpload();
                    try {
                        File file = new
File(System.getProperty("java.io.tmpdir") + "/" +
 
fileUpload.getClientFileName());
                            fileUpload.writeTo(file);
                        } catch (IOException e) {
                           e.printStackTrace();
                         }
                }
        };


~ Thank you,
  Paul Bors

-----Original Message-----
From: Edgar Merino [mailto:donvo...@gmail.com] 
Sent: Friday, October 25, 2013 1:30 PM
To: users@wicket.apache.org
Subject: Problems with FileUploadFile and CompoundPropertyModels

Hello, I'm having a problem with a FileUploadField, I'm using
CompoundPropertyModels through my application but for this single element I
would like to avoid having a model, however calling
fileUploadField.setDefauiltModel(null) will not work, since it will always
try to locate a CompoundPropertyModel, is there a way to avoid this?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to