The code for some reason does not correctly identify the typhoid file. I do a lot of downloading pictures, if the files are small (100-200 kb), everything works fine, but if the file size is larger (1-3 mb) problems begin ....

foreach ($_FILES['file']['name'] as $k=>$v) { ////// тут разный код //// ................ //////////// проверка типа/////// if($_FILES['file']['type'][$k] == "image/gif" || $_FILES['file']['type'][$k] == "image/png" || $_FILES['file']['type'][$k] == "image/jpg" || $_FILES['file']['type'][$k] == "image/jpeg") { ////////////загружаю изображение ................................. ////////////загружаю изображение }else echo "<center><br>Можно загружать только изображения в форматах jpg, jpeg, gif и png.</center>"; } 

small pictures load with a bang, great .... loads only the first file, and then vivvidit that message that you can upload only images in jpg, jpeg, gif and png formats.

maybe who knows because of what there can be such glitches?

  • Off topic, but a more beautiful test would look like this: $ allowedTypes = array ('image / gif', 'image / png', 'image / jpg', 'image / jpeg'); if (in_array ($ _ FILES ['file'] ['type'] [$ k], $ allowedTypes)) {// download And by topic - dump $_FILES['file']['type'][$k] at each iteration and see what comes out. - xEdelweiss
  • posted the output echo $ _FILES ['file'] ['type'] [$ k]. '<br>'; before checking, here's what's on the screen: image / jpeg You can only upload images in jpg, jpeg, gif and png formats. You can upload only jpg, jpeg, gif and png images. downloaded three files .... - arashvg
  • maybe the problem is upload_max_filesize - binliz

0