I am wondering should i go for old method or something new for image upload check in magento 2?

<?php if(isset($_FILES['image']['name']) and $_FILES['image']['name']!="") ?>

any other solution?

  • @RaphaelatDigitalPianism it is not related to uploading the image or file. i am asking for replacement of this code May 5 '16 at 7:51
  • Check Marius answer basically the upload factory does all the checks for you if I remember right May 5 '16 at 7:52
  • @RaphaelatDigitalPianism nope i have to go for if else condition to do something. i have to put this before using any library. May 5 '16 at 7:56

Browse other questions tagged or ask your own question.