Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/09/2010, 12:15
Folter
 
Fecha de Ingreso: diciembre-2008
Mensajes: 67
Antigüedad: 15 años, 4 meses
Puntos: 1
porcentaje de uploadfile

Hola, ando haciendo un uploadfile con ajax y jquery, quiero anadir el porcentaje del progreso, solo el porcentaje, sin barra de progreso. Tengo el siguiente codigo:

Código Javascript:
Ver original
  1. $(document).ready(function(){
  2.     new AjaxUpload('#btn_upload', {
  3.         action: 'php/upload.php',
  4.         name: 'Filedata',
  5.         onSubmit : function(file , ext){
  6.             if (ext && /^(mp3)$/.test(ext)){
  7.                 /* Setting data */
  8.                 this.setData({
  9.                     'key': 'This string will be send with the file'
  10.                 });
  11.                
  12.                 $('#btn_upload').hide();
  13.                 $('.text').show();
  14.                 $('#uploadfile .text').text('Uploading: ' + file);
  15.             } else {
  16.                 $('#btn_upload').hide();
  17.                 $('.text').show();
  18.                 $('#uploadfile .text').text('Error: only MP3 is allowed');
  19.                 return false;              
  20.             }
  21.    
  22.         },
  23.         onComplete : function(file){
  24.             $('#uploadfile .text').text('Uploaded: ' + file);              
  25.         }      
  26.     });
  27. });
  28. </script>

He intentado anadir
Código Javascript:
Ver original
  1. substr(bytesLoaded*100/bytesTotal)
pero no consigo hacerlo funcionar. Espero que alguien me pueda ayudar con esto, muchas gracias adelantados!!