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.

1 Answer 1


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


From Block you may get via

  • Thaks but i want to get file from web directory from module in magento 2
    – Deep Shah
    Aug 13, 2020 at 5:34
  • 1
    yes you can inject your block and get it ... Aug 13, 2020 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.