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

參見

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top