Giter VIP home page Giter VIP logo

php-download's Introduction

PHP Download

This is a simple PHP Download script designed to solve a few basic problems.

  1. Allow downloading of files no matter how big.

Note: On some Apache servers, when downloading large files (>2GB), Apache will fail to download.

  1. Force download of txt/image/script or other file that normally displays in the browser.
  2. Provide the user a small page to tell them what they are about to download and how big it is.
  3. Obfuscate the true location of a download on the server.
  4. Provide a download link to a file from a directory that is not directly accessible within the webroot.
  5. Counter to track the number of downloads. *
  6. To run PHP script upon download, such as generate image, dynamically watermark a PDF, etc. *

*You will need to extend the script to implement the last two.

Instructions

The script is currently configured to be used on a PHP webserver in a directory called /d (for download). From this path, you can construct download links such as: http://example.com/d/path/to/download.tgz

This will host a simple page that displays the size of the download file with a link to download it. You can skip this page by offering a direct download url which is the same as the first but adding a '?' at the end such as: http://example.com/d/path/to/download.tgz?

If you wish to rename the directory to something else, for example "download", you need to make the following modifications:

.htaccess

FROM:
RewriteBase /d/

TO:
RewriteBase /download/

index.php

FROM:
$dpath = "/d";

TO:
$dpath = "/download";

php-download's People

Contributors

deanhouseholder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.