Share via


HttpPostedFile.ContentType 속성

정의

클라이언트에서 보낸 파일의 MIME 콘텐츠 형식을 가져옵니다.

public:
 property System::String ^ ContentType { System::String ^ get(); };
public string ContentType { get; }
member this.ContentType : string
Public ReadOnly Property ContentType As String

속성 값

String

업로드된 파일의 MIME 콘텐츠 형식입니다.

예제

다음 코드 예제에서는 업로드 된 파일 컬렉션에 있는 모든 파일을 반복 하 고 파일의 MIME 형식을 때 작업을 수행 하는 방법을 보여 줍니다 US-ASCII합니다.

HttpFileCollection MyFileCollection = Request.Files;

 for (int Loop1 = 0; Loop1 < MyFileCollection.Count; Loop1++)
 {
    if (MyFileCollection[Loop1].ContentType == "video/mpeg")
    {
       //...
    }
 }
Dim Loop1 As Integer
 Dim MyFileCollection As HttpFileCollection = Request.Files
 
 For Loop1 = 0 To MyFileCollection.Count - 1
    If MyFileCollection(Loop1).ContentType = "video/mpeg" Then
       '...
    End If
 Next Loop1

적용 대상

추가 정보