Important alert: (current site time 4/26/2015 8:34:41 AM EDT)


security & privacy download to authorized person or members ~ PART 4

Submitted on: 5/31/2011 2:02:18 PM
By: eSanshar  
Level: Advanced
User Rating: Unrated
Compatibility: PHP 3.0, PHP 4.0, PHP 5.0
Views: 3440
author picture
(About the author)

#PART 4:: Create upload.php upload download links in database

this article for those who want to develop Security & Privacy Download any files to authorized person or members...............

Make your files secure download

Make your download folder secure

Make download link secure.............visitors Or members may keeps & share your download links for future download thousand's time same link from unauthorized place & sites.

So keep safe your download link & safe your bandwidth.

DO encrypt in md5 to every download links

Keep tracking your download links.

Only allow to authorize persons or your members..............etc

much more were have in this tutorials & articles share my knowledge's with yours I hope you like it. :)

Powered by technicguy [ eSanshar IT Experts ]
A complete IT Solutions & services

Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

Part: 4

  1. Create upload.php upload download links in database
    // location  of download folder.

    // Database table.
    $sqlAll= mysql_query("SELECT * FROM download ORDER BY no");

    // Function to make file size in KB MB ............
    function format_size($size) {
    $sizes = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
    if ($size == 0) { return('n/a'); } else {
    return (round($size/pow(1024, ($i = floor(log($size, 1024)))), $i > 1 ? 2 : 0) . $sizes[$i]); }

    echo "<table width=100% border=0 ><tr><td valign=top width=40% ><ol>";

    if ($handle = opendir($dir)) {
    $filesystem = new COM('Scripting.FileSystemObject');

    while (false !== ($file = readdir($handle))) {
    if ($file != "." && $file != ".." && $file != ".htaccess" && $file != "Thumbs.db") {


    // ADD your secure links into database convert real file name in to MD5
    echo "<li><b>$file</b> &nbsp;<tt>". format_size($size) ." <a href='index.php?axn=upload&file=".md5($file)."&name=".$file."&size=".format_size($size)."' >Add=>></a></tt></li>";


    echo "</ol></td><td td valign=top width=60%><ol>";

    // Display All secure links from database or u may DELETE the links from database
    while($files= mysql_fetch_array($sqlAll)){
    echo "<li><b>".$files['f_name'] . "</b> <tt><b>Size:</b>".$files['f_size'] . "</tt> <tt>Code:</tt><tt class='error'>" . $files['f_file']."</tt>";
    echo "<a href='index.php?axn=upload&file=".$files['f_file']."&id=".$files['no']."' ><img src='images/delete.gif' ></a></li>";

    echo "</ol></td></tr>";

    echo "</table>";

    // ADD Requested to store secure links into database
    if(($_GET['file']!='') && ($_GET['name']!='')){

    // DELETE Requested to store secure links into database
    if(($_GET['file']!='') && ($_GET['id']!='')){


Other 7 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

7/12/2012 12:11:26 PMjay

is this the whle code as it sais part 4?
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.