Google AppEngine でファイル ダウンロードのファイル名を設定するにはどうすればよいですか? 設定を試みContent-Disposition
ましたが、AppEngine は本番環境でヘッダーを削除します (開発環境で動作します)。
コード
resp.setContentType( "application/octet-stream" );
resp.setHeader( "Content-Disposition:", "attachment; filename=" + "\"" + fileName + "\"" );
開発ヘッダー
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="logs-2013-11-06-15-23-21.csv"
生産ヘッダー
HTTP/1.1 200 OK
Content-Type: application/octet-stream
X-AppEngine-Estimated-CPM-US-Dollars: $0.001434
X-AppEngine-Resource-Usage: ms=220 cpu_ms=224
Date: Wed, 06 Nov 2013 20:25:00 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, must-revalidate
Server: Google Frontend
Content-Length: 12713
Alternate-Protocol: 80:quic
参照
https://developers.google.com/appengine/docs/java/#Java_Responses https://code.google.com/p/googleappengine/issues/detail?id=10247