1 | <?php |
2 | |
3 | function leeBytes(string $parametro): string |
4 | { |
5 | /* Si el archivo se recibió y contiene bytes, los recupera; |
6 | * en caso contrario, devuelve false. */ |
7 | $contents = isset($_FILES[$parametro]) && $_FILES[$parametro]["size"] > 0 |
8 | ? file_get_contents($_FILES[$parametro]["tmp_name"]) |
9 | : false; |
10 | return $contents === false |
11 | ? "" |
12 | : $contents; |
13 | } |
14 |