Hi,
I've created a module for m2.0, that basically asks for more information on the product. As such, I am able to request a couple files needed for my project. One of the files is giving me 'Disallowed file type.' error upon saving the product.
My module has a tab on the basic product area. There, I am able to add sets of data that will have files that are not images.
I've followed this tutorial to understand how to do most of my intended features:
https://snow.dog/blog/tutorial-how-to-implement-an-admin-product-tab-in-magento-2/
and I have:
$uploader->setAllowedExtensions($this->allowedExtensions);
protected $allowedExtensions = ['pdf', 'obj'];
Can anyone help me get over this issue? Spent a couple hours already and haven't found anything that was able to help me out.
Thanks in advance!
Solved! Go to Solution.
Had this line on the $uploader:
//$uploader->addValidateCallback('product', $imageAdapter, 'validateUploadFile');
Commenting it makes it work.
Further research on that validateUploadFile callback needed!
1. image file should be jpg format . because getImageSize() search for width and height of image .
2. mention only image names in csv files.
3.mention directory in image directory opton of import tab.