Skip to content

Commit

Permalink
[fileupload] get upload url when 'submit'
Browse files Browse the repository at this point in the history
  • Loading branch information
llj committed Oct 14, 2014
1 parent c43f682 commit bf9b3be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions seahub/templates/repo.html
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,8 @@ <h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Librar
//singleFileUploads: false // using 1 request to upload all files of a selection
sequentialUploads: true
})
.bind('fileuploadadd', function(e, data) {
.bind('fileuploadsubmit', function(e, data) {
var _this = $(this);
var file = data.files[0];
// get url(token) for every file
if (!file.error) {
Expand All @@ -999,12 +1000,14 @@ <h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Librar
cache: false,
dataType: 'json',
success: function(ret) {
data.url = ret['url'];
form.attr('action', ret['url']);
data.jqXHR = _this.fileupload('send', data);
},
error: function() {
file.error = "{% trans "Failed to get upload url" %}";
}
});
return false;
}
})
.bind('fileuploaddone', function(e, data) {
Expand Down

0 comments on commit bf9b3be

Please sign in to comment.