Flash enlace velocidad de subida *

  • classified
  • Expert
  • Expert
  • Avatar de Usuario
  • Registrado: Dic 23, 2005
  • Mensajes: 540
  • Loc: Bahrain
  • Status: Offline

Nota Abril 5th, 2008, 10:32 am

Saludos compañeros,

mejorar el desarrollo de una aplicación que calculará el enlace / ancho de banda de descarga / velocidad de subida.
he hecho la velocidad de descarga parte, tiene problemas deducir cómo voy a calcular la velocidad de subida.

cosa es, si se me utiliza el filereference el usuario tendrá que buscar un archivo para subirlo, no es realmente una buena idea.
Otra forma es enviar caracteres o una colección de cadenas al servidor usando loadvars y calcular la diferencia de tiempo final - inicio / chunksize. pero im que no estaba realmente seguro de si esta es la forma correcta de hacerlo, ya que necesito vivir un instante de salida.

Ideas, anyone?
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Abril 5th, 2008, 10:32 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Abril 5th, 2008, 4:51 pm

Si la basura generar datos a enviar, usted aún va a ser capaz de ver el progreso de la subida a través de BytesLoaded / BytesTotal ¿no? :scratchhead:
Strong with this one, the sudo is.
  • classified
  • Expert
  • Expert
  • Avatar de Usuario
  • Registrado: Dic 23, 2005
  • Mensajes: 540
  • Loc: Bahrain
  • Status: Offline

Nota Abril 5th, 2008, 10:53 pm

thats i si utiliza el flash de archivos de referencia, el loadvars no me cree...
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Registrado: Feb 10, 2004
  • Mensajes: 13455
  • Loc: Florida
  • Status: Offline

Nota Abril 5th, 2008, 11:10 pm

I don't know, recuerdo uso de los mismos antes de la clase FileReference fue nunca. Theyve tiene que ser en algún lugar existe.
Strong with this one, the sudo is.
  • classified
  • Expert
  • Expert
  • Avatar de Usuario
  • Registrado: Dic 23, 2005
  • Mensajes: 540
  • Loc: Bahrain
  • Status: Offline

Nota Abril 6th, 2008, 6:09 am

puede utilizar para que los datos que se tiró...
http://livedocs.adobe.com/flash/8/main/ ... 02327.html

pero gracias a la idea, los malos encontrar fuera más tarde o más temprano, llegar allí.

si usted tiene más ideas, hágamelo saber.
m0o , where <<Less is More>>
http://www.zainals.com
http://www.zainals.com/blog
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Registrado: Jul 06, 2010
  • Mensajes: 266
  • Status: Online

Nota Julio 6th, 2010, 3:49 pm

Sé que este post puede ser un poco tarde, pero tengo una solución que funciona para mí que se pueden modificar para adaptarse a la cuestión de la carga vars.

cálculo de la velocidad:
ACTIONSCRIPT Código: [ Select ]
var last_bytes_loaded:Number = 0;
var last_time:Number = 0;
var speed:String;
 
// Format size
function format_size(size) {
   
    // Make the array that holds the unit of mesaure
    var units:Array = new Array("B","KB","MB","GB","TB","PB","EB","ZB","YB");
   
    // Loop through our units
    for(u=0; u<units.length; u++) {    
       
        // Check to see if we are at the larest number for the unit
        if((size / Math.pow(1024,u)) >= 1) {
           
            // Add the new size and the unit
            new_size = Math.floor((size / Math.pow(1024, u)) * 100) / 100;
            unit = units[u];
       
        }
   
    }
   
    // Return the newsize and unit
    return new_size + unit;  
 
}
 
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
   
    // Make a temp date
    var temp_date:Date = new Date();
   
    // Check to see if the seconds are different
    if(last_time != temp_date.getSeconds()) {
       
        // Set the last seconds to be the current
        last_time = temp_date.getSeconds();
 
        // Format the speed string
        speed = format_size(bytesLoaded - last_bytes_loaded);
 
        // Set the last bytes loaded to the bytesloaded
        last_bytes_loaded = bytesLoaded;     
   
    }
 
}
 
 
  1. var last_bytes_loaded:Number = 0;
  2. var last_time:Number = 0;
  3. var speed:String;
  4.  
  5. // Format size
  6. function format_size(size) {
  7.    
  8.     // Make the array that holds the unit of mesaure
  9.     var units:Array = new Array("B","KB","MB","GB","TB","PB","EB","ZB","YB");
  10.    
  11.     // Loop through our units
  12.     for(u=0; u<units.length; u++) {    
  13.        
  14.         // Check to see if we are at the larest number for the unit
  15.         if((size / Math.pow(1024,u)) >= 1) {
  16.            
  17.             // Add the new size and the unit
  18.             new_size = Math.floor((size / Math.pow(1024, u)) * 100) / 100;
  19.             unit = units[u];
  20.        
  21.         }
  22.    
  23.     }
  24.    
  25.     // Return the newsize and unit
  26.     return new_size + unit;  
  27.  
  28. }
  29.  
  30. listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
  31.    
  32.     // Make a temp date
  33.     var temp_date:Date = new Date();
  34.    
  35.     // Check to see if the seconds are different
  36.     if(last_time != temp_date.getSeconds()) {
  37.        
  38.         // Set the last seconds to be the current
  39.         last_time = temp_date.getSeconds();
  40.  
  41.         // Format the speed string
  42.         speed = format_size(bytesLoaded - last_bytes_loaded);
  43.  
  44.         // Set the last bytes loaded to the bytesloaded
  45.         last_bytes_loaded = bytesLoaded;     
  46.    
  47.     }
  48.  
  49. }
  50.  
  51.  


el código anterior es lo que yo uso para el archivo de referencia para utilizar la carga VARs yo usaría php con el paquete PECL junto con la función uploadprogress_get_info (); para obtener la información y entonces usted puede convertir la función anterior para trabajar en php o para devolver el totla bytes y bytes subido

PHP Código: [ Select ]
// Make an array of the file information... $id is the UPLOAD_IDENTIFIER setup in the html form <input type="hidden" name="UPLOAD_IDENTIFIER" value="random_value" />
$upload_info = uploadprogress_get_info($id);
 
// Get the total size and current upload status
$bytes_uploaded = intval($upload_info['bytes_uploaded']);
$bytes_total    = intval($upload_info['bytes_total']);
 
  1. // Make an array of the file information... $id is the UPLOAD_IDENTIFIER setup in the html form <input type="hidden" name="UPLOAD_IDENTIFIER" value="random_value" />
  2. $upload_info = uploadprogress_get_info($id);
  3.  
  4. // Get the total size and current upload status
  5. $bytes_uploaded = intval($upload_info['bytes_uploaded']);
  6. $bytes_total    = intval($upload_info['bytes_total']);
  7.  
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • Avatar de Usuario
  • Registrado: May 28, 2003
  • Mensajes: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Nota Julio 7th, 2010, 4:34 am

A pesar de que su mensaje puede ser un par de años demasiado tarde, es una buena solución y que estoy seguro va a beneficiar a otros. Gracias por tomarse el tiempo para publicarlo.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • bluego78
  • Born
  • Born
  • No Avatar
  • Registrado: Ago 05, 2010
  • Mensajes: 1
  • Status: Offline

Nota Agosto 5th, 2010, 1:32 am

Hola a todos!
Tu entrada es realmente grande, no hay nada más sobre este argumento de todas formas...
Necesito crear una prueba de velocidad de conexión a internet, (por ejemplo speedtest punto net), pero
no puedo encontrar ningún tutorial, cualquier cosa me puede ayudar con esta...

Por favor por favor por favor...¿me pueden ayudar?
Trate de explicar lo que me tengo que hacer, o enviar algún ejemplo me ..

tú eres mi única esperanza gif "alt = =":-)" título" Smile ">

¡Gracias!
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Registrado: Jul 06, 2010
  • Mensajes: 266
  • Status: Online

Nota Agosto 10th, 2010, 9:28 am

Actualmente estoy buscando lo más opciones para usted, pero he encontrado una que utiliza el servidor de medios flash para ayudar a www. derekentringer. com / blog / flash-ancho de banda del puerto de detección /

Hasta ahora parece que el servidor de medios flash es el camino a seguir

Publicar Información

  • Total de mensajes en este tema: 9 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 33 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC