torrent_response = HttpResponse(content = new_torrent, mimetype = 'application/x-bittorrent') torrent_response['Content-Disposition'] = 'attachment; filename="' + torrent.file[(torrent.file.find('/') + 1):] + '"'