fix a bug in the add torrent via file in browsers other than FF

This commit is contained in:
Damien Churchill 2009-07-29 10:17:10 +00:00
parent 9b56fab8a1
commit 97a7890a28
3 changed files with 15 additions and 10 deletions

View File

@ -95,7 +95,8 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, {
onUploadSuccess: function(fp, upload) {
this.hide();
var filename = upload.result.toString();
if (upload.result.success) {
var filename = upload.result.files[0];
this.form.getForm().findField('torrentFile').setValue('');
Deluge.Client.web.get_torrent_info(filename, {
success: this.onGotInfo,
@ -103,4 +104,5 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, {
filename: filename
});
}
}
});

File diff suppressed because one or more lines are too long

View File

@ -156,9 +156,12 @@ class Upload(resource.Resource):
os.write(fd, upload)
os.close(fd)
filenames.append(fn)
request.setHeader("content-type", "text/plain")
request.setHeader("content-type", "text/html")
request.setResponseCode(http.OK)
return "\n".join(filenames)
return common.json.dumps({
'success': True,
'files': filenames
})
class Render(resource.Resource):