Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/09/2008, 11:39
Avatar de Lynxcraft
Lynxcraft
 
Fecha de Ingreso: noviembre-2007
Ubicación: yecla murcia
Mensajes: 1.346
Antigüedad: 16 años, 5 meses
Puntos: 51
Subir archivos mp3 a la web

Hola amig@s tengo un problema con subir archivos mp3 a la web el código que tengo solo me permite subir archivos de imagen y swf

Código PHP:
import flash.net.FileReference;
var 
fileUpload:FileReference = new FileReference();
var 
path:String "mp3"
var escucha:Object = {};
var 
fileTypes:Array;
var 
getFile:String;
function 
init() {
    
System.security.allowDomain(path);
    
load_mc._visible false;
    
    
upload_btn.label "Subir";
    
down_btn.label "Descarga";
    
upload_btn.addEventListener("click"doUpload);
    
down_btn.addEventListener("click"doDownload);
    
fileUpload.addListener(escucha);
    
escucha.onSelect doSelect;
    
escucha.onComplete doComplete;
    
escucha.onCancel doCancel;
    
escucha.onProgress doProgress;
    
data_mc.addEventListener("change"setDownload);
    
makeList();
}
function 
doComplete() {
    
load_mc.barra_mc._xscale 0;
    
load_mc.label_txt.text "Tranferencia Completa";
    
makeList();
}
function 
doProgress(archivo:FileReferencebLoaded:NumberbTotal:Number) {
    var 
porcentaje Math.round((bLoaded*100)/bTotal);
    
load_mc.label_txt.text porcentaje+"% del archivo "+archivo.name;
    
load_mc.barra_mc._xscale porcentaje;
}
function 
doCancel() {
    
trace("El Usuario Cancelo");
}
function 
doSelect(archivo:FileReference) {
    
load_mc._visible true;
    
load_mc.barra_mc._xscale 0;
    
fileUpload.upload(path+"/uploadFile.php");
}
function 
doDownload() {
    if (
getFile != undefined) {
        
fileUpload.download(path+"/"+getFile);
    }
}
function 
doUpload(event) {
    
fileUpload.browse();
}
function 
setDownload(c:MovieClip) {
    
getFile c.target.selectedItem.Nombre;
}
function 
makeList() {
    
data_mc.removeAll();
    var 
list_xml:XML = new XML();
    
list_xml.ignoreWhite true;
    
list_xml.load(path+"/lista.php");
    
list_xml.onLoad = function() {
        var 
nodos this.firstChild.childNodes;
        for (var 
a in nodos) {
            var 
size:Number Math.ceil((nodos[a].attributes.tamanio/1024));
            
data_mc.addItem({Nombre:nodos[a].attributes.nameTamaño:size+" Kb"});
        }
    };
}
init(); 
Si alguno sabe otra forma de subirlos se lo agradecería
__________________
Sobran las ideas cuando faltan ganas de trabajar en ellas
Lynxcraft