Pastebin

New pastes are no longer accepted · Stats

Latest Pastes

SFD 1.0 By Doug

<?php
    /* +------------------------------------------------+
       |  Simple File Downloader 1.0 - Made By Doug ;)  |
       +------------------------------------------------+ */
    function DownloadFile($file)
    {
        if (file_exists($file))
        {
            header("Content-Type: application/force-download");
            header("Content-Disposition: attachment; filename=\"{$file}\"");
            header("Content-Transfer-Encoding: binary");
            header("Accept-Ranges: bytes");
            header("Cache-control: private");
            header("Pragma: private");
            header("Expires: Fri, 21 Dec 2012 12:21:12 GMT");
            header("Content-Length: " . filesize($file));
            header("X-Powered-By: SFD 1.0 By Doug ;)");
            die(file_get_contents($file));
        }
        else
        {
            define("HTML_ERR", "<!DOCTYPE HTML><html><head><meta http-equiv=\"Content-Type\"content=\"text/html; charset=utf-8\"><title>Information</title><link rel=\"stylesheet\"href=\"http://www.dooug.com/get.dsp?u=err_style\"media=\"all\"/></head><body><div align=\"center\"><div id=\"content\"><div id=\"box\"><div id=\"header\">Information</div><div id=\"econtent\"><p>Sorry, the file you requested was not found on this server.</p><p id=\"tinfo\">[404] File Not Found.</p><div class=\"copy\">Powered by <a href=\"http://www.dooug.com/\"title=\"Visit Dooug Services\">Dooug Services</a>.</div></div></div></div></div></body></html>");
            header("HTTP/1.1 404 Not Found", true, 404);
            header("Status: 404 Not Found", true, 404);
            header("Cache-control: private");
            header("Pragma: private");
            header("Expires: Fri, 21 Dec 2012 12:21:12 GMT");
            die(HTML_ERR);
        }
    }
	
    /* Lets Use ? */
    set_time_limit(0); // Make the User don't stop to listen the Server
    DownloadFile("FileName.ExT"); // Force File Download
    /* Any Command Below this line will not be executed, because we've executed an die() command. */