The HttpResponse
PHP 手册

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. The Content-Disposition header is very useful if the data actually being sent came from a file or something similar, that should be "saved" by the client/user (i.e. by the browser's "Save as..." popup window).

参数

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

参见


The HttpResponse
PHP 手册