File upload from file-based module Assay | Anthony Corbett | 2013-03-20 08:15 | |||||||||||||||||||||
Status: Closed | |||||||||||||||||||||||
I'm having issues uploading a file from a file-based module assay. I've looked that the suggested examples from https://www.labkey.org/wiki/home/Documentation/page.view?name=moduleassay. In all the upload.html files that do file uploads they use a version of the following HTML and Ext Javascript: <form id="upload_form" enctype="multipart/form-data" method="POST"> <div id="fileUploadField"></div> </form> <script type="text/javascript"> var expData; Ext.onReady(function () { function handleNewFileUpload(form, action) { if (action && action.result && action.result.id) { expData = new LABKEY.Exp.Data(action.result); } } var form = new Ext.form.BasicForm( Ext.get("upload_form"), { fileUpload: true, frame: false, url: LABKEY.ActionURL.buildURL('assay', 'assayFileUpload'), listeners: { "actioncomplete": function (f, action) { handleNewFileUpload(f, action); }, "actionfailed": function (f, action) { handleNewFileUpload(f, action); } } }); new Ext.form.FileUploadField({ renderTo: "fileUploadField", buttonText: "Upload New File...", buttonOnly: true, buttonCfg: { cls: "labkey-button" }, listeners: { "fileselected": function (fb, v) { form.submit(); } } }); }) </script> When I look at firebug for the response from the POST to AssayController's assayFileUpload Action the response (action.result) looks like this: { success: true } There is no id attribute of the ExpData created on the server in the response. When I attach a debugger on the server in AbstractFileUploadAction.export(), the FileUploadForm instance does not have a fileName or fileContent. Maybe the parameters aren't being bound correctly to this bean? I'm using Firefox 19 and Tomcat 6.0.35 locally, could there be a Tomcat specific configuration issue here? Thanks, Anthony Corbett |
|||||||||||||||||||||||
| |||||||||||||||||||||||