Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/11/2006, 14:54
Cluster
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 4 meses
Puntos: 129
Hola ferny,

Si lo que quieres es obtener el "peso" (en bytes) de tu archivo, PHP no podrás usar para tal fin .. a lo sumo javascript, pero creo que por ahí tampoco puedes obtener esa información para hacer validaciones.

Pero .. en HTML según parece tienes una opción:

En tu formulario HTML añade esta constante:

Código PHP:
<input type="hidden" name="MAX_FILE_SIZE" value="30000" /> 
Cita:
Example 38-1. File Upload Form
The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted. This is an advisory to the browser, PHP also checks it. Fooling this setting on the browser side is quite easy, so never rely on files with a greater size being blocked by this feature. The PHP settings for maximum-size, however, cannot be fooled. This form element should always be used as it saves users the trouble of waiting for a big file being transferred only to find that it was too big and the transfer failed.
Es decir .. esa constante usala para evitar dar el error de PHP de un upload sobrepasado vs a la configuración .. pero, igualmente valida en el lado del servidor como ya lo haces.

Si quieres alguna validación con más control .. deberías ver opciones tipo ActiveX o similar.

Un salduo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.