2
Good evening everyone, I am using a script that I have and that I always used to upload images
only when I choose some images it returns the error undefined index error
the only problem is that in 80% of cases works normal I did a var dump from $_FILES to see what happens
in the normal case
array (size=1)
'foto' =>
array (size=5)
'name' => string 'interlogo.jpg' (length=13)
'type' => string 'image/jpeg' (length=10)
'tmp_name' => string 'C:\wamp\tmp\php586.tmp' (length=22)
'error' => int 0
'size' => int 13800
in the case of error
array (size=0)
empty
the only difference from one photo to another is the size, one has 130k and another 3 mega. when gives the error it gives well in the lines of the variables
$foto_name=$_FILES["foto"]["name"];
$foto=$_FILES["foto"]["tmp_name"];
someone has already made this mistake ?
Check the values
upload_max_filesize
andpost_max_size
in hisphp.ini
. If the values are smaller than the file you are trying to upload, the global variable$_FILES
will be empty.– rdleal
I checked and both are with 20 mega being that the file only has 3
– Jasar Orion
the post size was in 2 places in php.ini one with 3 mega other with 20 , solved. Thank you
– Jasar Orion
Even with your problem solved, I published a slightly more detailed answer, so if someone has the same problem as yours and finds your question, they will have the most visible solution.
– rdleal