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:[email protected]]
Sent: Friday, October 25, 2013 1:30 PM
To: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]