First when the JSP just loaded add the upload method, so formdate parameter zfilename is the page just loaded EXP1 value, and then by the JS method assignment is not read over,
If you want to get this value, you can add the arguments before calling Uploadify, see the Save method
$ (document). Ready (function () {
$ (' #edit_file_upload '). Uploadify ({
Auto:false,
Buttonclass: "Some-class",
Buttoncursor: ' Hand ',
HEIGHT:20,
Width:90,
ButtonText: ' <div> Select File </div> ',
Filesizelimit: ' 102400KB ',
Fileobjname: ' MyFile ',
Filetypeexts: ' * * ',
Multi:true,
Preventcaching:true,
Queueid: ' Edit_file_upload-queue ',
Progressdata: ' Percentage ',
Overrideevents: [' Onselecterror '],
FormData: {' typeId ': ' 1 ', ' typeName ': ' 2 ', ' Zfilename ': $ ("#exp1"). Val (), ' id ': ' ${tedasflowapprove.id} ', ' FileId ': $ ("# FileId "). Val ()},
SWF: ' ${ctxstatic}/uploadify/uploadify.swf ',
Uploader: ' ${ctx}/flow/approve/tedasflowapprove/addfile; Jsessionid=<shiro:principal property= "SessionID"/> ',
Onfallback:function () {//Detect Flash failed call
Alert ("You cannot upload a picture without the Flash control installed!") Please install the Flash control and try again. ");
},
Onselecterror:uploadify_onselecterror,
Onuploadsuccess:function (file, data, response) {
$ (' # ' + file.id). Find ('. Data '). HTML (' upload complete ');
data = eval (' (' +data+ ') ');
FileId = Data.fileid + ",";
var old_val = $ (' #fileId '). Val ();
$ (' #fileId '). Val (Old_val + fileId);
},
Onqueuecomplete:function (Queuedata) {
var fileId = $ ("#fileId"). Val ();
if ((fileid!= (")") && (fileid.substring (fileid.length-1) = = (","))) {
$ ("#fileId"). Val (fileid.substring (0, fileid.length-1));
}
$ ("#inputForm"). Submit ();
},
Onuploaderror:function (file, ErrorCode, ErrorMsg, errorstring) {
$.messager.show ({
Title: ' My Message ',
Msg:errorstring,
timeout:5000,
ShowType: ' Slide '
});
}
});
});
function Save () {
$ ("#edit_file_upload"). Uploadify ("Settings", "FormData", {' Zfilename ': $ ("INPUT[NAME=EXP1]"). Val ()});
$ (' #edit_file_upload '). Uploadify (' upload ', ' * ');
}
Jsp
<input type= "File" Name= "Edit_file_upload" id= "edit_file_upload" multiple= "multiple" />
<div id = "Edit_file_upload-queue" ></div>
<div id= "Edit_form_upload" ></div>
Uploadify Attachment upload Parameters