0

I have some pdf file that is saved in the table named pdf_download the database name is loc_pos.

Need to download that file when I click.

<a href="http://domain.com/index.php?route=information/start_downloads&amp;name=<?php echo $category['name']; ?>&amp;download=drivers_manuals&amp;file=<?php echo $category['file']; ?>" target="_blank"><?php echo $category['name']; ?></a>

Output is:

http://domain.com/index.php?route=information/start_downloads&name=SENSORMATIC AMS 1140 SECURITY DETECTION&download=drivers_manuals&file=20140715164946.pdf

This script is not working.

I think the route is not working properly.

Can someone help me to get the correct code?

2
  • You donot follow magento routing logic.
    – Amit Bera
    Jun 7, 2018 at 8:29
  • I know it's not magento routing logic.Plz help me with that.. Hope you can give me the correct code.. Jun 7, 2018 at 9:20

1 Answer 1

0
$block->getUrl('information/start_downloads', ['name' => $category['name'], 'download' => 'drivers_manuals', 'file' => $category['file']]);

This will create url with params. Of course, you need Magento Controller that returns file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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