1. When using Scriptdata to pass parameters to the background, you must declare ' method ': ' GET ' because the default is post
2.$ ("#uploadify"). Uploadifysettings (' Scriptdata ', {' Name ': ' Liudong ', ' age ': 22}); Dynamic update configuration Parameters
$ ("#uploadify"). Uploadify ({
' uploader ' : uploadify.swf ',
' script ' : '. /upload/doupload.jsp ',
' Scriptdata ' : {' name ': ' Liudong ', ' age ': ', '
' method ' & nbsp; : ' GET ',
' OnSelect ' : Function (event, Queueid, Fileobj) {
$ ("#uploadify"). Uploadifysettings (' Scriptdata ', {' name ': GetName (), ' age ': Getage ()});
}
});
or dynamically set parameters in the successful execution of the method OnComplete:
Oncomplete:function (event, Queueid, Fileobj, response, data) {
var value = Response;
$ ("#uploadify"). Uploadifysettings (' Scriptdata ', {' name ': ' Liudong ', ' Age ': value});
Springmvc Mode upload:
The page and the other two ways, no need to change, mainly in the background action, add parameter Multipartfile uploadify (spring will automatically help us encapsulate);
For example, the upload processing method in action processing is
@RequestMapping (method = requestmethod.post, params = "action=upload")
Public String DoPost (modelmap model, multipartfile Uploadify,bindingresult result) {
Upload file name, to consider the coding problem, ajax default upload UTF-8
String fileName = File.getoriginalfilename ();
With the file stream and file name, what to do next is not much to say
。。。
}
Here it is necessary to mention that the issue of the transfer of parameters, if it is a dynamic reference, the simple is that the page you fill in the information, to upload with the file, is the dynamic transfer of parameters:
For example:
General upload of the OnClick method:
JQuery (' #uploadify '). Uploadifyupload ();
The OnClick method for dynamic parameter transfer:
$ (' #uploadify '). Uploadifysettings (' Scriptdata ', {' BizType ': $ (' #bizType '). Val (), ' Providercode ': $ (' #providerCode ') ). Val (), ' Subprovidercode ': $ (' #subProviderCode '). Val (), ' Budgetinst ': $ (' #budgetInst '). Val (), ' Memo ': $ (' #memo '). Val ()}); JQuery (' #uploadify '). Uploadifyupload ()
Simply put, the uploadifysettings function is used to inject parameters before committing.