atributo Size

18/05/2005 - 11:43 por sa | Informe spam
Hola,

necesito mostrar el tamaño de un fichero. para ello pongo:

response.write file.Size

pero sale el tamaño en bytes.

saben si se puede mostrar en MB.. por ejemplo: 0.09 MB

saludos y gracias,
 

Leer las respuestas

#1 Nuno Santos
18/05/2005 - 12:06 | Informe spam
Claro haces la conversión , es algo asin, espero no me tenga equivocado!!!
:-)
function getFileSizeTranslated (valor)
Dim temp
temp = valor
If Len(temp) <= 3 Then
getFileSizeTranslated = temp & " bytes"
ElseIf Len(temp) > 6 Then
temp = FormatNumber(((temp / 1024) / 1024), 2)
getFileSizeTranslated = temp & " megabytes"
Else
temp = FormatNumber((temp / 1024), 2)
getFileSizeTranslated = temp & " kilobytes"
End If
end function

Nuno Santos


Nuno Santos
nunos7[REMOVER]@hotmail.com

"sa" wrote in message
news:
Hola,

necesito mostrar el tamaño de un fichero. para ello pongo:

response.write file.Size

pero sale el tamaño en bytes.

saben si se puede mostrar en MB.. por ejemplo: 0.09 MB

saludos y gracias,

Preguntas similares