2010-07-05 111 views
1

如何檢查文件是否爲文本文件或不ASP如何檢查文件是否爲文本文件或不ASP

+0

好容易; http://stackoverflow.com/questions/277521/how-to-identify-the-file-content-is-in-ascii-or-binary – 2010-07-05 10:14:43

+0

你想知道上傳的文件是否有TXT擴展?如果是這樣,你正在使用的上傳器是什麼?「 – 2010-07-22 10:17:27

+0

<% dim fs set fs = Server.CreateObject(」Scripting.FileSystemObject「) Response.Write(fs.GetExtensionName(」c:\ test \ test.htm 「)) set fs = nothing %> 輸出: htm – user580950 2011-09-29 04:24:33

回答

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

Output: 

htm 
相關問題