【发布时间】:2013-06-26 23:20:15
【问题描述】:
我正在使用 jquery-file-upload 如何描述 http://css.dzone.com/articles/angularjs-file-upload 但另外我需要通过查询字符串发送参数,因此我需要根据选择选项更改更改该参数,该值在 $scope .
那么我该如何实现呢?提前致谢。
【问题讨论】:
标签: angularjs jquery-file-upload
我正在使用 jquery-file-upload 如何描述 http://css.dzone.com/articles/angularjs-file-upload 但另外我需要通过查询字符串发送参数,因此我需要根据选择选项更改更改该参数,该值在 $scope .
那么我该如何实现呢?提前致谢。
【问题讨论】:
标签: angularjs jquery-file-upload
@srigi
在 AngularJS 控制器中添加以下代码:
$scope.$on('fileuploadadd', function(e, data) {
data.url = '/attachfile?param=test';
});
【讨论】:
我在https://github.com/blueimp/jQuery-File-Upload/issues/355https://github.com/blueimp/jQuery-File-Upload/issues/355 中找到了一个在 jquery 文件上传事件中使用“数据”参数的解决方案
【讨论】:
HTML(与此处相同:https://stackoverflow.com/a/18580266/750216):
file-upload='uploadOptions'
JS:
$scope.uploadOptions = {
url: yourDynamicUrl
}
【讨论】: