문제

If I categorize files as binary (eg: .exe, .mp3, .docx, .pdf) and text (eg: rtf, txt, html, xml), then how can we use the classic ASP's FSO to determine what kind of file a particular file is ?

도움이 되었습니까?

해결책

I looked it up at the Internet all users are the same opinion. There is no direct way to make a difference. Apparently you have to do it manually. This link gives you a set of rules to make a difference between a text and a binary file.

다른 팁

According to Eric Lippert, the FSO isn't meant for binary files. But using .Read(n) to get the first few characters and compare them to known signatures should work.

P.S.

If you do a full scan to classify the data, as reporter porposed, make sure you use more modern rules (e.g. a UTF16 text file could contain 50% 'zeros').

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top