我用jquery插件罰款上傳。 需要在上傳文件之前動態傳遞參數,因此,setParams()方法應該完成這項工作。我不能對異常的onsubmit回電:罰款上傳3.4和setParams
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)
任何想法?
嗨雷,感謝您的支持。我將基本的上傳器轉換爲JQuery插件,並立即清理代碼。乾杯。 – 2013-04-06 21:33:16