Dondariadmin (トーク | 投稿記録) (ページの作成:「== 目的 == * リクエストに対してマルチバイトファイル名でファイルダウンロードさせる。 == httpでファイルダウンロード == * ht...」) |
(相違点なし)
|
Content-Disposition: attachment; filename="filename.txt"
from django.http import HttpResponse def index(request): content = 'body1' response = HttpResponse(content, content_type='text/plain') response['Content-Disposition'] = 'attachment; filename="filename.txt"' return response
response['Content-Disposition'] = 'attachment; filename="ファイル.txt"'
Content-Disposition: =?utf-8?b?YXR0YWNobWVudDsgZmlsZW5hbWU9IuODleOCoeOCpOODqy50eHQi?=
import urllib.parse response['Content-Disposition'] = 'attachment; filename="{fn}"'.format(fn=urllib.parse.quote("ファイル.txt"))
Content-Disposition: attachment; filename="%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB.txt"Tweet