Difficulty replacing java script code Upload

0

I have the following code that uploads photos:

<script type="text/javascript" src="js/jquery-1.6.1.min.js" ></script>
<script type="text/javascript" src="js/ajaxupload.3.5.js" ></script>
<link rel="stylesheet" type="text/css" href="./styles.css" />
<script type="text/javascript" >
    $(function(){
        var btnUpload=$('#upload');
        var status=$('#status');
        new AjaxUpload(btnUpload, {
            // Arquivo que fará o upload
            action: 'upload-file.php?cliente=<?php echo $cliente; ?>&cod=<?php echo $cod; ?>',
            //Nome da caixa de entrada do arquivo
            name: 'uploadfile',

            onSubmit: function(file, ext){
                 if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ 
                    // verificar a extensão de arquivo válido
                    status.text('Somente JPG, PNG ou GIF são permitidas');
                    return false;
                }
                status.text('Aguarde! Foto do imóvel sendo enviada...');
                status.css("color", "#B90407");
                status.css("font-size", "20px");
                status.css("text-indent", "25px");
            },
            onComplete: function(file, response){
                //Limpamos o status
                status.text('');
                //Adicionar arquivo carregado na lista
                if(response==="success"){
                    $('<li></li>').appendTo('#files').html('<strong>Foto inserida com sucesso!').addClass('success');
                } else{
                    $('<li></li>').appendTo('#files').html('<strong>Foto inserida com sucesso!').addClass('success');
                }
            }
        });

    });
</script>

And this is where the button appears to select the image files to upload:

<div id="mainbody" >
<div id="upload" ><span>Inserir fotos<span></div><span id="status" ></span>
<ul id="files" ></ul>
</div>

I need to insert this code jsfiddle , but when I implement this code the button to select the files stops working.

It would be the last thing of great importance that I need to finish my site. Can anyone solve this problem for me?

    
asked by anonymous 20.01.2016 / 16:31

0 answers