GuessFormat 메서드 |
지정한 파일에 대해 파일 형식을 검사한 후 형식 정보를 반환합니다.
objFormatInfo = objFD.GuessFormat(FilePath)
objFormatInfo
FormatInfo object. 파일 형식 정보를 저장하는 FormatInfo 오브젝트를 반환합니다.
objFD
Required. FormatDetector 오브젝트
FilePath
String. 검사할 파일을 지정합니다. 파일은 완전한 경로명을 포함하고 있어야 합니다.
파일 포맷이 분석되면 포맷 정보를 포함하고 있는 FormatInfo 오브젝트가 반환됩니다. 해석할 수 없는 파일 포맷인 경우 FormatInfo의 Name 프로퍼티에 unknown이 반환됩니다.
Dim FormatDetector, Format Set FormatDetector = Server.CreateObject("TABSUpload4.FormatDetector") Set Format = FormatDetector.GuessFormat("C:\Temp\document.xls") Response.Write "파일 포맷:" & Format.Name & "<br>" Response.Write "파일 포맷 설명:" & Format.Description & "<br>" Response.Write "파일 포맷 MIME 형식:" & Format.MimeType & "<br>"