Re: Undefined array key "form_field"

See all posts Reply

Re: Undefined array key "form_field" new!
by cc28, 1 year, 9 months ago
$Upload = new Upload($_FILES['image_field'], 'fr_FR');
if ($Upload->uploaded) {
  $Upload->file_new_name_body   = 'image_resized';
  $Upload->image_resize         = true;
  $Upload->image_x              = 100;
  $Upload->image_ratio_y        = true;
  // $Upload->process( URL . 'public/files/');
  $Upload->process();
  if ($Upload->processed) {
    echo 'image resized';
    $Upload->clean();
  } else {
    echo 'error : ' . $Upload->error;
  }
}

How to resolve this error?
Warning: Undefined array key "form_field" inReply
Re: Undefined array key "form_field" new!
by colin, 1 year, 9 months ago
This error seems to come from somewhere else in your code. form_field is not related to the code above.Reply
Re: Undefined array key "form_field" new!
by cc28, 1 year, 9 months ago
This good problem solved :)

with this code
$file = $_FILES["image_field"] ?? null;
$lang = 'fr_FR';
$Upload = new Upload($file, $lang);
Reply