ContentType (UploadedFile Object)

Dundas

ContentType (UploadedFile and NextFile Objects)

Overview

Read-only property which stores the uploaded file's content type.

Syntax

[string] = Object.ContentType

The ContentType property syntax has the following parts:

Part

Description

string

The value of the contenttype header.

Remarks

To use the Files collection (which stores UploadedFile objects) you must first call either the Save or SaveToMemory methods.

To work with a NextFile object you must first call the GetNextFile method.

The format of the content type is as follows: "Type/Sub-Type" (e.g. "image/bmp").

To determine what type of file has been uploaded you can use VBScript's InStr method with this property as the string to be searched. For example, to see if the uploaded file is an image you could use this line of code: InStr(1,objUploadedFile.ContentType,"image",1).