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

vale ya lo tengo.... uffffffff

ma costao entenderlo

Código PHP:
    //user has selected some files
    
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{
                if (list[
i].type == ".rar") {
                    
tempList.push(list[i]);
                } else if (list[
i].type == ".zip") {
                    
tempList.push(list[i]);
                } else if (list[
i].type == ".ace") {
                    
tempList.push(list[i]);
                } else if (list[
i].type == ".iso") {
                    
tempList.push(list[i]);
                }else{
/**********************************************************************************************************/                    
                    
frWindow.content.feedback_txt.htmlText "<p align='center'>El tipo de fichero no esta permitido: Seleccione | *.rar | *.zip | *.ace | *.iso | *.bin | *.7z |";
/**********************************************************************************************************/
                
}//end if
            
}//end if
        
}//for
        
filesToUpload filesToUpload.concat(tempList);
        
frWindow.content.fileList_grid.dataProvider filesToUpload;
        
checkGridItems();
    }
//end func 

Última edición por cplus; 19/04/2007 a las 04:58