i have migrated my application to wicket 6.14, and in the file upload field im trying to get the file name and the filesize using the below implementation
@Override
public CharSequence getCallbackUrl() {
CharSequence callBackUrl = super.getCallbackUrl();
//File attribute of file input type is supported by certain browsers therefore conditionally returns the file size using js
return callBackUrl +
"&filename=' + this.value + '&filesize=' + (function(undefined) {if($(\"<input type='file'>\").get(0).files !== undefined){ return $('#fileInput')[0].files[0].size}else{return 0;}})() + '";//"&filename=' + this.value + '";//
}
But when i try to read the parameter value, it returns as this,value for the file name and the jquery function as the file size.
Request request = RequestCycle.get().getRequest();
String filename = findFileName(request.getRequestParameters().getParameterValue("filename").toString());
String fileSize = request.getRequestParameters().getParameterValue("filesize").toString();
How can i do this ?