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/– AbdulJan 2, 2018 at 7:43
-
are you need file download link admin side or frontend side?– AbdulJan 2, 2018 at 7:47
-
@Abdul frontend side– nortonuserJan 2, 2018 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 SolankiJan 2, 2018 at 8:48
-
@nortonuser Please let me know if you have any issue.– Rakesh JesadiyaJan 2, 2018 at 8:53
1 Answer
You need to create csv folder inside your area(frontend/adminhtml)
app/code/{Namespace}/{Modulename}/view/{area}/web/csv/en_US.csv
call directly inside template files,
echo $this->getViewFileUrl('Namespace_Modulename::csv/en_US.csv');