PHP Classes

File: get_file.php

Recommend this page to a friend!
  Classes of Ahmed Saad   Advanced PHP File Downloader   get_file.php   Download  
File: get_file.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Advanced PHP File Downloader
Retrieve files for download from remote sites
Author: By
Last change: Update of get_file.php
Date: 1 year ago
Size: 684 bytes
 

Contents

Class file image Download
<?php


   
require( './core/downloader.php' );


       
$file = is_file( './files/' . @$_GET[ 'file' ] ) ?
           
'./files/' . @$_GET[ 'file' ] // Download a file
           
:
            @
$_GET[ 'file' ]; // Download string

       
$speed = intval( @$_GET[ 'speed' ] );

       
$resumable = ( bool ) @$_GET['resumable'];

       
$mode = @$_GET['mode'] == 'data' ? Downloader::DOWNLOAD_DATA : Downloader::DOWNLOAD_FILE;

       
$auto_exit = ( bool ) @$_GET['auto_exit'];

       
$save_as = !@$_GET['save_name'] ?: $_GET['save_name'];

   

    ( new
Downloader( $file, $mode ) )
        ->
resumable( $resumable )
        ->
speedLimit( $speed )
        ->
setDownloadName( $save_as )
       
// ->authenticate( 'ahmed', 'saad' )
       
->autoExit( )
        ->
download();
       

?>