I’m evaluating Webix for hopeful purchase. I’m attempting to do a basic file upload. Without using Webix, this HTML works properly:
<form action="/CMT_PG/rs/CMT/uploadExperiment" method="post" enctype="multipart/form-data">
<p>Select a file : <input type="file" name="fileToUpload" size="50" /></p>
<input type="submit" value="Upload It" />
</form>
when I upload to a Java/Jersey API that looks like this:
@POST
@Path("/uploadExperiment")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces("application/html")
public Response uploadExperiment(@FormDataParam("fileToUpload") InputStream uploadedInputStream,
@FormDataParam("fileToUpload") FormDataContentDisposition fileDetail) {
// etc
}
When i try to do the upload with Webix, my two parameters to uploadExperiment() come up null:
webix.ready(function() {
webix.ui({
container:"uploader_container",
view:"form", elements: [
{
view: "uploader", id:"fileToUpload", name:"fileToUpload",
autosend: false, multiple:false, value: 'Select File',
link: "mylist", upload: "/CMT_PG/rs/CMT/uploadExperiment"
},
{
view:"list", id:"mylist", type:"uploader",
autoheight:true, borderless:true
},
{ view: "button", label: "Upload File", click: function() {
$$("fileToUpload").send(function(response){
if(response)
webix.message(response.status);
});
}}
]
});
$$("fileToUpload").attachEvent("onUploadComplete", function() {
webix.message("done");
});
});
What am I doing wrong?
Thanks!
John