본문 바로가기

개발/Study

[Web] Content-Type 과 Content-Disposition

브라우저가 Content를 처리하는 방법은 Content-TypeContent-Disposition 속성을 조합 함으로써 결정된다.

 

Content-Type

개체 헤더는 리소스의 media type을 나타내기 위해 사용된다.

전송되는 Content가 어떤 유형인지 알려주는 목적을 가진다. Content-Type을 통해 브라우저는 해당 데이터를

어떻게 처리해야 할 지 판단한다.

 

  • TEXT 타입
    • Content-Type : text/css
    • Content-Type : text/html
    • Content-Type : text/javascript
    • Content-Type : text/plain - 텍스트 파일에 대한 기본 값
  • FILE 타입
    • Content-Type : application/msword - doc
    • Content-Type : application/pdf
    • Content-Type : image/jpeg
    • Content-Type : application/vnd.ms-excel - xls
    • Content-Type : application/zip
  • 오디오 타입
    • Content-Type : audio/mpeg - MP3, MPEG audio
    • Content-Type : audio/x-ms-wma - windows Media Audio
    • Content-Type : audio/vnd.rn-realaudio - RealAudio
  • Multipart 타입
    • Content-Type : multipart/from-data - 파일첨부

 

Content-Disposition

Content가 어떻게 처리되어야 하는지 나타낸다.

  • Content-Disposition : inline - 브라우저가 Content를 즉시 출력해야 함을 나타낸다. 이미지를 브라우저 내에서 즉시 출력하며, 문서이면 텍스트로 출력한다.
  • Content-Disposition : attachment - 브라우저는 해당 Content를 처리하지 않고, 다운로드하게 된다.

'개발 > Study' 카테고리의 다른 글

트러블 슈팅(trouble shooting)  (0) 2022.03.05
[JAVA]접근 제한자  (0) 2022.02.08
[JAVA]오버로딩(Overloading) & 오버라이딩(Overriding)  (0) 2022.02.05