How can I select file types from a list of files in a folder ? The following didn't work
var f = fso.GetFolder(folderspec);
var fc = new Enumerator(f.Files);
for (; !fc.atEnd(); fc.moveNext() )
{
if ( fc.Type == "JPEG Image" )
You can base it on the file extension, but there are three caveats:
1) The above code will only work in IE,
2) The file extension shouldn't be used as a 100% accurate reflection of the real file type, as ultimately, files can have any extension,
3) Even Windows Explorer gets the file type wrong baed on the extension - if I rename a .PDF to a .JPG, for example, it tells me it is a JPEG Image when clearly it is not.
Hope this helps,
Dan
Coedit Limited - Delivering standards compliant, accessible web solutions
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.