PHP code example of filipsedivy / php-download-file
1. Go to this page and download the library: Download filipsedivy/php-download-file library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
filipsedivy / php-download-file example snippets
$downloadFile = new \FS\DownloadFile;
$downloadFile->download('data/file.exe');
$filePath = 'data/file.exe';
$fileName = 'install.exe';
$contentType = 'application/octet-stream';
$downloadFile = new \FS\DownloadFile;
$downloadFile->speed(10); // 10 kb/s
$downloadFile->download($filePath, $fileName, $contentType);