PHP code example of rauwebieten / psr7-partial-download
1. Go to this page and download the library: Download rauwebieten/psr7-partial-download 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/ */
rauwebieten / psr7-partial-download example snippets
// in your controller class / callback
$partialDownload = new Psr7PartialDownload();
$response = $partialDownload->sendFile($request,$response,'my-song.mp3','audio/mpeg');
return $response;