1

How to Check whether a file is text file or not in ASP

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • With great difficulty; http://stackoverflow.com/questions/277521/how-to-identify-the-file-content-is-in-ascii-or-binary – Alex K. Jul 05 '10 at 10:14
  • do you want to know if the uploaded file is has txt extenstion? if so, what is the uploader you are using"? – Y.G.J Jul 22 '10 at 10:17
  • <% dim fs set fs=Server.CreateObject("Scripting.FileSystemObject") Response.Write(fs.GetExtensionName("c:\test\test.htm")) set fs=nothing %> Output: htm – user580950 Sep 29 '11 at 04:24

1 Answers1

0
<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetExtensionName("c:\test\test.htm"))
set fs=nothing
%>

Output:

htm 
user580950
  • 3,558
  • 12
  • 49
  • 94