0

私のサービスコールは画像を返します。

png 画像を返し、ヘッダーに image/jpeg の content-type があり、同じページで画像を開きます。このイメージをディスクに保存するオプションをユーザーに提供したいと考えています。

4

2 に答える 2

1

Content-Dispositionはインラインである可能性があり、content-dispositionを添付ファイルとして指定します

response.setContentType("image/jpeg");
response.setHeader("Content-Disposition", "attachment; filename=" + imageName + ".jpg");
于 2012-12-18T13:17:34.120 に答える
1

Content-Dispositionサーバーの応答にヘッダーが必要です

例えば

于 2012-12-18T13:04:08.470 に答える