亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Guides Access control CORS Authentication Browser detection using the user agent Caching Caching FAQ Compression Conditional requests Connection management in HTTP 1.x Content negotiation Content negotiation: List of default Accept values Cookies CSP Messages Overview Protocol upgrade mechanism Proxy servers and tunneling Proxy servers and tunneling: Proxy Auto-Configuration (PAC) file Public Key Pinning Range requests Redirections Resources and specifications Resources and URIs Response codes Server-Side Access Control Session Guides: Basics Basics of HTTP Choosing between www and non-www URLs Data URIs Evolution of HTTP Identifying resources on the Web MIME Types MIME types: Complete list of MIME types CSP Content-Security-Policy Content-Security-Policy-Report-Only CSP: base-uri CSP: block-all-mixed-content CSP: child-src CSP: connect-src CSP: default-src CSP: font-src CSP: form-action CSP: frame-ancestors CSP: frame-src CSP: img-src CSP: manifest-src CSP: media-src CSP: object-src CSP: plugin-types CSP: referrer CSP: report-uri CSP: require-sri-for CSP: sandbox CSP: script-src CSP: style-src CSP: upgrade-insecure-requests CSP: worker-src Headers Accept Accept-Charset Accept-Encoding Accept-Language Accept-Ranges Access-Control-Allow-Credentials Access-Control-Allow-Headers Access-Control-Allow-Methods Access-Control-Allow-Origin Access-Control-Expose-Headers Access-Control-Max-Age Access-Control-Request-Headers Access-Control-Request-Method Age Allow Authorization Cache-Control Connection Content-Disposition Content-Encoding Content-Language Content-Length Content-Location Content-Range Content-Type Cookie Cookie2 Date DNT ETag Expect Expires Forwarded From Headers Host If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since Keep-Alive Large-Allocation Last-Modified Location Origin Pragma Proxy-Authenticate Proxy-Authorization Public-Key-Pins Public-Key-Pins-Report-Only Range Referer Referrer-Policy Retry-After Server Set-Cookie Set-Cookie2 SourceMap Strict-Transport-Security TE Tk Trailer Transfer-Encoding Upgrade-Insecure-Requests User-Agent User-Agent: Firefox Vary Via Warning WWW-Authenticate X-Content-Type-Options X-DNS-Prefetch-Control X-Forwarded-For X-Forwarded-Host X-Forwarded-Proto X-Frame-Options X-XSS-Protection Methods CONNECT DELETE GET HEAD Methods OPTIONS PATCH POST PUT Status 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 307 Temporary Redirect 308 Permanent Redirect 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 428 Precondition Required 429 Too Many Requests 431 Request Header Fields Too Large 451 Unavailable For Legal Reasons 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported 511 Network Authentication Required Status
characters

在常規(guī) HTTP 響應中,Content-Disposition響應標頭是指示內(nèi)容是否預期在瀏覽器中內(nèi)聯(lián)顯示的標題,即,作為網(wǎng)頁或作為網(wǎng)頁的一部分或作為附件下載并且本地保存。

在一個multipart/form-data正文中,HTTP Content-Disposition通用標題是一個標題,可以在多部分主體的子部分中使用,以提供有關它適用的字段的信息。子部分由標題中定義的邊界分隔Content-Type。用于身體本身,Content-Disposition沒有任何作用。

所述Content-Disposition的 header 在 MIME 消息的電子郵件的更大的范圍內(nèi)定義的,但僅可能的參數(shù)的子集應用于 HTTP 形式和POST請求。只有值form-data,以及可選的指令namefilename,可以在 HTTP 上下文中使用。

Header type

Response header (for the main body) General header (for a subpart of a multipart body)

Forbidden header name

no

語法

作為主體的響應標題

HTTP 上下文中的第一個參數(shù)是inline(默認值,表示它可以顯示在網(wǎng)頁內(nèi),或作為網(wǎng)頁)或attachment(表示它應該下載;大多數(shù)瀏覽器呈現(xiàn)“另存為”對話框,預先填入filename如果存在參數(shù)的值

Content-Disposition: inline
Content-Disposition: attachment
Content-Disposition: attachment; filename="filename.jpg"

作為多部分主體的 header

HTTP 上下文中的第一個參數(shù)總是form-data; 其他參數(shù)不區(qū)分大小寫,并且有參數(shù),在'='符號后面使用帶引號的字符串語法。多個參數(shù)用分號(';')分隔。

Content-Disposition: form-data
Content-Disposition: form-data; name="fieldName"Content-Disposition: form-data; name="fieldName"; filename="filename.jpg"

指令

name后面跟著一個字符串,其中包含該字段的內(nèi)容引用的 HTML 字段的名稱。在同一字段中處理多個文件(例如元素的multiple屬性<input type=file>)時,可能會有幾個具有相同名稱的子部分。

一個name有值'_charset_'表明該部分不是 HTML 區(qū)域,但默認字符集,而無需顯式的字符集信息使用的部分。

filename后面是一個包含傳輸文件的原始名稱的字符串。文件名始終是可選的,不能被應用程序盲目使用:路徑信息應該被刪除,并且應該轉(zhuǎn)換為服務器文件系統(tǒng)規(guī)則。該參數(shù)提供大部分指示性信息。當與其結合使用時Content-Disposition: attachment,它被用作提供給 user.filename 的最終“另存為”對話框的默認文件名*

參數(shù)“filename”和“filename *”的區(qū)別僅在于“filename *”使用RFC 5987中定義的編碼。當“文件名”和“文件名*”都出現(xiàn)在單個標題字段值中時,“文件名*”優(yōu)于“文件名”,當兩者都存在并被理解時。

例子

觸發(fā)“另存為”對話框的響應:

200 OK
Content-Type: text/html; charset=utf-8Content-Disposition: attachment; filename="cool.html"Content-Length: 22<HTML>Save me!</HTML>

這個簡單的 HTML 文件將被保存為常規(guī)下載而不是在瀏覽器中顯示。大多數(shù)瀏覽器會建議將其保存在cool.html文件名下(默認情況下)。

HTML 表單的一個示例,使用multipart/form-data使用Content-Disposition標題的格式發(fā)布:

POST /test.html HTTP/1.1Host: example.org
Content-Type: multipart/form-data;boundary="boundary"--boundary
Content-Disposition: form-data; name="field1"value1--boundary
Content-Disposition: form-data; name="field2"; filename="example.txt"value2--boundary--

規(guī)范

Specification

Title

RFC 7578

Returning Values from Forms: multipart/form-data

RFC 6266

Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)

RFC 2183

Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field

瀏覽器兼容性

Feature

Chrome

Firefox

Edge

Internet Explorer

Opera

Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

兼容性說明

  • Content-Disposition如果提供了參數(shù)filenamefilename*參數(shù),F(xiàn)irefox 5 將更有效地處理 HTTP 響應頭; 它會查看所有提供的名稱,filename*如果有可用的名稱,則使用參數(shù),即使filename首先包含參數(shù)。以前,將使用第一個匹配參數(shù),從而阻止使用更合適的名稱。見錯誤588781。見還

  • HTML Forms

  • The Content-Type defining the boundary of the multipart body.

  • The FormData interface used to manipulate form data for use in the XMLHttpRequest API.

Previous article: Next article: