Skip to content
A Javascript PHP and Bootstrap 4downloader with a per second countdown progressbar delay.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Files
css
img
js
media
LICENSE
README.md
download.php
download2.php
downloader.php
index.php

README.md

20 Second Delayed PHP & JavaScript Downloader with Bootstrap 4

This is an update of the original blog updated from bootstrap 3 to use bootstrap 4 and with a smooth progress bar adjusted in the JavaScript code. The viewer has been removed and replaced with the above gif.

Visit Bayesean Blog

https://bayeseanblog.com/blog/php-downloader-using-countdown-timer/5

Project Scope

This project scope came about when a comment was received asking how to use a seconds timed delay. So I put a blog together on this. The original progress bar was jerky in nature and did not look professional.

While updating the blog to Bootstrap 4, the scope required a smooth progressbar showing the seconds counting down.

  • Must not show the download button immediately to prevent non-human downloading.

  • Must keep the user knowledgeable as to what is happening by adding a count-down timer linked to a progress bar.

  • Must flow automatically.

  • Must immediately download the file that was selected on the click of the button that became visible after completion of the progress bar.

Coding Difficulty

Medium. Good knowledge of Javascript/Ajax and PHP required would help.

Libraries

Bootstrap 4 Framework.

PHP 5.6 + .

Downloader.php - A PHP Library (A free to use file download library created by Jack Mason )

This is included in the included Download below.

JQuery – download from here or visit the website http://jquery.com.

Javascript.

Structure

Index.php

This file contains the visual element of a drop down box to select the file to download.

Download2.php

This file contains the visual download progress bar and button to download the file.

Downloader1.php

This file is called by the download button and processes the file to download.

Downloader.php

This holds all the mime information and allows any type of file to be downloaded.

Code

Visit Bayesean Blog for the Coding detail.

Licence is MIT.

You can’t perform that action at this time.