I have a csv file, i want to put it inside my custom module folder app/code/Vendor/Module but i don't know where to put the csv file inside my custom extension folder, and how to generate link to download this csv file, so i can put the download link inside my a href tag in frontend phtml

  • Put your csv files under the folder app/code/Vendor/Files/Sample/ – Abdul Jan 2 '18 at 7:43
  • are you need file download link admin side or frontend side? – Abdul Jan 2 '18 at 7:47
  • @Abdul frontend side – nortonuser Jan 2 '18 at 8:18
  • You can put files in pub/media as well. So you can generate url for pub/media and put them in the href tag. – Dhaval Solanki Jan 2 '18 at 8:48
  • @nortonuser Please let me know if you have any issue. – Rakesh Jesadiya Jan 2 '18 at 8:53

You need to create csv folder inside your area(frontend/adminhtml)


call directly inside template files,

echo $this->getViewFileUrl('Namespace_Modulename::csv/en_US.csv');
| improve this answer | |

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.