代码改变世界

uploadify动态修改formdata

2014-05-05 11:31  东@东  阅读(868)  评论(0编辑  收藏  举报

uploadify动态修改formdata

在使用uploadify的过程中,我们需要在上传文件前动态的修改post的参数,根据uploadify官方文档的说明,是在onUploadStart回调函数中使用setting,就能实现修改formdata的值,类似下面:

1
2
3
'onUploadStart' : function(file) {
                                 $("#file_upload").uploadify('settings', 'currentDirPath', "/webroot/newsletter/update");
                            } ,

 

正确的是下面的写法:

$("#file_upload").uploadify('settings','formData' ,{'currentDirPath': /webroot/newsletter/update});

 

借鉴处:http://www.newjueqi.com/?p=79