Good morning, I'm running into this error and I'm not finding the key.
Notice: Undefined index: pac_foto in C: \ wamp64 \ www \ tests \ pags \ ver_foto.php on line 32
PHP.INI:
File Uploads activado
Max_execution_time = 300
Max_input_time = 240
Memory_limit = 128M
Post_max_size = 16M
destination PHP file
$pac_foto = isset($_REQUEST['pac_foto'])?$_REQUEST['pac_foto']:'';
$foto_directorio_subida = 'imgs/';
$foto_directorio_subida .= basename($_FILES['pac_foto']['name']);
$foto_tipo_archivo = $_FILES['pac_foto']['type'];
if (move_uploaded_file($_FILES['pac_foto']['tmp_name'], $foto_directorio_subida)) {
echo "Foto subida correctamente";
} else {
echo "No se pudo guardar la foto.";
}
HTML form (in another document)
<form enctype="multipart/form-data" action="verFoto" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000000" />
<input type="file" name="pac_foto" />
<input type="submit" name="pac_boton_enviar" value="Guardar Datos" />
</form>
I've done var_dump of $ pac_foto and it takes out the name of the file I'm uploading. However, I do var_dump of $ _FILES and it gives me an empty array.
What can I be doing wrong?
Greetings and thanks