I want to get csv file from web folder of custom module in magento 2 so how can i do this. please help me.
Thanks In Advance.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to get csv file from web folder of custom module in magento 2 so how can i do this. please help me.
Thanks In Advance.
There are several ways to get it. Just matter is that in which file you want to get.
If you want to get it in phtml file then
$block->getViewFileUrl('VendorName_ModuleName::csvdirectory/file.csv');
From Block you may get via
$this->getViewFileUrl('VendorName_ModuleName::csvdirectory/file.csv');