I just made a check extension instead (should work)
public void CheckExtension(String Extension, String thefile) { // eg (extension will be 'zip', file will be 'myFile.zip' Extension = Extension.toLowerCase(); thefile = thefile.toLowerCase(); //if the file ends with the extension int extensionStart = thefile.lastIndexOf('.'+ Extension); int ExtensionEnd = Extension.length() + extensionStart +1; if ((thefile.lastIndexOf('.'+Extension) > -1 )&& (ExtensionEnd == thefile.length())){ FileType = true; }else { FileType = false;} }
I thought there might be a simple file.getType() or something;
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by Mr tuition : 12-18-2007 at 02:38 PM.
|