jquery uploadify Dynamic Update configuration parameter Method Uploadifysettings ()

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.