HttpResponse
PHP Manual

HttpResponse::setContentDisposition

(PECL pecl_http >= 0.10.0)

HttpResponse::setContentDispositionSet content disposition

说明

static bool HttpResponse::setContentDisposition ( string $filename [, bool $inline = false ] )

Set the Content-Disposition. 当实际被发送的来自文件或类似东西的数据,要被客户端 /用户(例如,浏览器的“另存为...”弹出窗口)“保存”时,Content-Disposition 头是十分有用的。

参数

filename

the file name the "Save as..." dialog should display

inline

if set to true and the user agent knows how to handle the content type, it will probably not cause the popup window to be shown

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE.

参见


HttpResponse
PHP Manual