我正在使用带有 jquery 插件的精细上传器。需要在上传文件之前动态传递参数,因此 setParams() 方法应该可以完成这项工作。我在 onSubmit 回调中不能有例外:
1) 上传者声明
function initUploader() {
var up = $('#BSUploader').fineUploader({
multiple: true,
debug: true,
request: {
endpoint: '${request.contextPath}/quantum/uploadToS3',
//params: {'folderId':r }
},
dragAndDrop: {
extraDropzones:[$('#filesContainer')],
...
2) onSubmit 回调
...
}).on('submit', function(event, id, name) {
var r = $("#curfolderid").val();
alert(r);
up.setParams({'folderId':r});
3) 错误日志
[FineUploader] Caught exception in 'onSubmit' callback - Object [object Object] has no method 'setParams' bundle-bundle_uploader_defer.js:4
qq.log bundle-bundle_uploader_defer.js:4
qq.FineUploaderBasic.log bundle-bundle_uploader_defer.js:26
b bundle-bundle_uploader_defer.js:47
a._options.callbacks.(anonymous function) bundle-bundle_uploader_defer.js:47
qq.FineUploaderBasic._upload bundle-bundle_uploader_defer.js:43
qq.FineUploaderBasic._uploadFileOrBlobDataList bundle-bundle_uploader_defer.js:43
qq.FineUploaderBasic.addFiles bundle-bundle_uploader_defer.js:29
qq.DragAndDrop.callbacks.dropProcessing bundle-bundle_uploader_defer.js:69
b bundle-bundle_uploader_defer.js:51
qq.UploadDropZone.onDrop bundle-bundle_uploader_defer.js:52
(anonymous function)
任何的想法 ?