Click or drag to resize

ValidateFormat 메서드

지정한 파일이 특정 파일 포맷을 갖는지 여부를 검사합니다.

형식
syntax
Valid = objFD.ValidateFormat(FilePath, FormatName)

Valid

Boolean. FormatName에서 지정된 포맷과 부합할 경우 True를 반환합니다.

objFD

Required. FormatDetector 오브젝트

FilePath

String. 검사할 파일을 지정합니다. 파일은 완전한 경로명을 포함하고 있어야 합니다.

FormatName

String. 검사할 포맷 이름을 지정합니다.

설명

FilePath에 입력한 파일이 지정된 포맷인지 여부를 검사합니다. 포맷 이름에는 tabsformat.config XML에 정의된 포맷 이름 중 하나를 지정합니다.

예제
ASP
Dim FormatDetector

Set FormatDetector = Server.CreateObject("TABSUpload4.FormatDetector")
If FormatDetector.ValidateFormat("C:\Temp\Document.xls", "xls") Then
    Response.Write "XLS 파일 형식 입니다."
Else
    Response.Write "XLS 파일 형식이 아닙니다."
End If