View Single Post
  #2 (permalink)  
Old 12-18-2007, 02:22 PM
Mr tuition Mr tuition is offline
Member
 
Join Date: Dec 2007
Posts: 10
Mr tuition is on a distinguished road
I just made a check extension instead (should work)

PHP Code:
    public void CheckExtension(String ExtensionString 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) > -)&& (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.
Reply With Quote