Changeset fbcfb98 in portal_2019 for php/sign.php
- Timestamp:
- Oct 31, 2023, 4:15:08 PM (7 months ago)
- Branches:
- master, dev
- Parents:
- 9e98ae1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
php/sign.php
r9eb89a1 rfbcfb98 10 10 </head> 11 11 <body> 12 13 <?php14 // Consultar el valor de upload_max_filesize o el tamaño máximo permitido15 // para un archivo que se envía al servidor.16 $maxFileSize = ini_get('upload_max_filesize');17 ?>18 12 19 13 <!-- Header --> … … 144 138 }); 145 139 })(); 146 147 /**148 * Función para verificar el tamaño del archivo seleccionado y mostrar una149 * alerta si es demasiado grande en comparación con el valor máximo permitido.150 * @param {HTMLInputElement} input - El elemento de entrada de archivo.151 */152 function checkFileSize(input) {153 if (input.files.length > 0) {154 // Tamaño máximo en bytes155 const maxSize = parseInt('<?php echo $maxFileSize; ?>') * 1024 * 1024;156 157 const fileSize = input.files[0].size;158 159 if (fileSize > maxSize) {160 alert(161 "El archivo seleccionado es demasiado grande, el " +162 "tamaño máximo permitido es <?php echo $maxFileSize; ?>."163 );164 /* Limpiar el valor del input para que el usuario seleccione otro archivo. */165 input.value = "";166 }167 }168 }169 140 </script> 170 141 </body>
Note: See TracChangeset
for help on using the changeset viewer.