Download a file with on click on a button. How to handle all the header properly so that you can download the file in one click.
First of all download the file FileDownloader.php and place it in your project folder. Now add the file FileDownloader.php to your project file by requiring it.
require "FileDownloader.php";
Simply create an object for the class FileDownloader.
$ob = new FileDownloader();
Call the fileDownloaderMain() and pass the file url as its argument.
$ob->fileDownloaderMain($url);
Feel free to report any issues related to this.
- Vishnu Sivadas - Developer - Website
Check out my other works @VishnuSivadasVS