Reputation: 43
i've created a php file which shows data from database:
http://www.eedmoe.gov.bd/report/app/webroot/files/uploaded/tenders/tender.php
But I want to download files. Report.doc, contact.txt, etc files are saving this folder:
http://www.eedmoe.gov.bd/report/app/webroot/files/uploaded/tenders/
I want that any visitor or user can download those files by clicking or save as. What should be the php function or code am I going to use?
Upvotes: 0
Views: 1005
Reputation: 533
You can also make a specific page to force download if you don't want it to be opened by the browser :
<?php header("Content-Type: application/force-download"); ?>
Upvotes: 1
Reputation: 157947
Change the href attribute of the links to the filenames. To download 'contact.txt' for example use this link in your html:
<a href="contact.txt">contact.txt</a>
You'll need no php for this.
Upvotes: 1