File Upload with an Expiring and SEO Friendly Download Link in PHP with Source Code


This simple project/web app is a File Upload with an Expiring and SEO Friendly Download Link. This code is just a simple implementation of encrypting true links to protect them from direct downloaders. In this way, you can ensure that the users visit your website first before getting the file they want. The web application has a simple form that allows the user to upload a file or document in the system that can only be available in the given time span. This program doesn't have any database due I have created this simple project to share this with the students or other programmers especially those who are new to PHP Language. The source code can be helpful to them to enhance their programming capabilities and understand some functionalities of PHP.

This project is free to download. Feel Free to download and modify the source code the way you desire. You might find something useful from this project and learn something for your own projects. This project was developed using PHP HTML, CSS, Javascript (jQuery and Ajax), and Bootstrap for the design.


  • Basic Encryption and Decryption using Base64
  • Open link to New Tab using Button
  • Copying text to clipboard on Button Click
  • HTML5 Validation
  • Create SEO friendly URL using .htaccess

Framework and Theme(s) used:

How it Works

  1. Users will select a file to upload.
  2. Users will set the given expiration time of the file that can be download.
  3. After that, the user submits the form. On submitting process, the source code will create a copy to the source code's specific uploads destination to store the file.
  4. Then, the source code itself will automatically generate an SEO Friendly Download link.
  5. The web application will display the download link and 2 buttons which are the "Copy to clipboard" and "Open in a new tab" buttons.

How to Run


  • Download and Install any local web server such as XAMPP/WAMP that has a PHP version for at least 7.1.8 as mine.
  • Download the provided source code zip file. (download button is located below)


  1. Open your XAMPP/WAMP's Control Panel and start the "Apache".
  2. Extract the downloaded source code file.
  3. If you are using XAMPP, copy the extracted source code folder and paste it into the XAMPP's "htdocs" directory. And If you are using WAMP, paste it into the "www" directory.
  4. Browse the File Upload with Expiring and SEO Friendly Download Link Web App in a browser. i.e. http://localhost/Expiring-Download-Link


That's it! I hope this simple PHP Project Source Code will help you with what you are looking for and for your future project.

Happy Coding :)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.


1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.


Submitted byDaniel200193 (not verified)on Wed, 03/21/2018 - 16:43

What if users upload the same file name twice? The newest file will be downloaded

Is there a way to make a new folder each IP address or change the filenames so the files with same name don't get mixed

Add new comment