Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/04/2007, 12:46
Avatar de cplus
cplus
 
Fecha de Ingreso: abril-2007
Mensajes: 164
Antigüedad: 17 años
Puntos: 1
Pregunta Comprobar extension del fichero para dar error

hola estoy con un upload de files y tengo hecho el sistema para el tamaño maximo de fichero, si sobre pasa pues error, ahora bien,,, me gustaria añadirle tb un sistema para la extension del fichero... por ejemplo si es

*.EXE = false
*.RAR = false
*.JPG = true
*.GIF = true

dejo aqui el code del tamaño---

Código PHP:
    public function fileRefListener_onSelect(fileRefList:FileReferenceList){
        var list:Array = 
fileRefList.fileList;
        var 
tempList = new Array();

        for(var 
i=0i< list.lengthi++){
            var 
sizeFile = list[i].size/1024/1024//in MB
            
if((sizeFile maxFilesize) || (sizeFile >= 150)){ //150 MB is Flash Player limit per file
/**********************************************************************************************************/
                
frWindow.content.feedback_txt.htmlText "<p align='center'>Maximo 150 MB: El fichero excede del tamaño ("+Math.ceil(sizeFile)+" MB)";
/**********************************************************************************************************/
            
}else{
                
tempList.push(list[i])
            }
            
        }
        
        
        
        
        
filesToUpload filesToUpload.concat(tempList);
        
frWindow.content.fileList_grid.dataProvider filesToUpload;
        
checkGridItems();
    } 
alguien me puede ayudar¿? necesitan algo mas de code¿

gracias