I try to implement file uploader script from this Github project and I need to set some additional params from the form before submitting the upload.
According to the documentation it's being set like that:
uploader.setParams({
anotherP开发者_StackOverflowaram: 'value'
});
How can I set these parameters in the onSubmit event? Something like:
var uploader = new qq.FileUploader({
onSubmit: function() {
// <- I want to set the params here
}
});
I tried self.setParams()
and this.setParams()
but no luck. I'm not that advanced in javascript so I would be thankful for any help.
You can use the same code you posted. "uploader" will exist when onSubmit is called
var uploader = new qq.FileUploader({
onSubmit: function() {
uploader.setParams({
anotherParam: 'value'
});
}
});
精彩评论