1. Go to this page and download the library: Download moudarir/downloader 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/ */
use Moudarir\Downloader\Download;
use Moudarir\Downloader\Enums\ResponseAction;
$response = Download::fromFile('/path/to/file.pdf', responseAction: ResponseAction::X_SEND_FILE);
$response->send();
use Moudarir\Downloader\Download;
use Moudarir\Downloader\Enums\ResponseAction;
$response = Download::fromFile(
'/path/to/file.pdf',
responseAction: ResponseAction::X_ACCEL_REDIRECT,
xAccelRedirectUri: '/protected/path/to/file.pdf'
);
$response->send();
use Moudarir\Downloader\Download;
use Moudarir\Downloader\DownloadConfig;
$config = new DownloadConfig()
->withLimitRate(500 * 1024)
->withChunkSize(256 * 1024)
->withMaxRangeItems(5);
$response = Download::fromFile(
'/path/to/video.mp4',
'video.mp4',
MimeType::MP4,
config: $config,
);
$response->send();
use Moudarir\Downloader\Download;
use Moudarir\Downloader\Enums\ETagStrategy;
$response = Download::fromFile('/path/to/file.pdf', strategy: ETagStrategy::SHA256);
$response->send();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.