File Upload System in PHP and MySQL

File Upload System in PHP and MySQL

This PHP and MySQL File Upload System allows you to upload files in a web environment, through a very simple form where the file is attached, given a name and sent.

The system displays the uploaded files in a table, you can view the files and download them. These files are uploaded to the upload folder.

This system was developed in CodeIgniter a framework in PHP, quite simple in its execution and robust in its scope, its implementation can be a little more complex than the usual developments that are uploaded in this blog post.

Explanatory video (spanish)

Setting up the File Upload System in PHP and MySQL on a Local Server

To carry out the process of setting up the File Upload System in PHP and MySQL It is necessary that you download and install the following applications with all the default parameters:

XAMPPGitVisual Studio Code.

I talk in much more detail about this process in a specific post, where I explain how to install php applications on a local server

Install Composer

It is a package manager like NPM, but in this case it is specific to PHP, this package manager shows a scalable and organized way to manage, download and install the dependencies and libraries that you require for your project. For the implementation of the file upload system in PHP and MySQL you need to install composer, in the video below I show the process of installing both Laravel and Composer in XAMPP.

Installing Laravel on Windows with XAMPP and Composer

GitHub project download

The project is hosted at the following link:

File Upload System in PHP and MySQL

After downloading and installing the previously requested applications, from Visual Studio Code, you go to the following location:


Already in this folder, within Visual Studio Code, press the View option and then Terminal, and in the window that appears at the bottom, write the following code and press Enter:

git clone

Inside the htdocs folder a new folder will be created called subida-archivos, and there will be the project already entered, what remains is, from Visual Studio Code, access this folder from the Open Folder and access to option subida-archivos, this way you will have the application files to modify them at will.

Running composer on already downloaded project

To carry out this process from the console, type the following command and press enter, if you previously installed Composer you will not have any problem:

composer install

Creation and Import of the database of the File Upload System in PHP and MySQL

At this point you have to open XAMPP, choose a language between English and German, and activate the services of Apache, the PHP server and MySQL the database manager.

After activating these services, you must access the following URL:


For the application to work correctly, from phpmyadmin, you must create the database with the name subida-archivos, then you must access the SQL section and paste the code found in the following link:

Base de datos del Sistema de Subida de Archivos en PHP y MySQL

Si realizaste los procesos como fueron indicados en esta publicación sin cambiar ningún parámetro el sistema te debe funcionar correctamente en la siguiente URL:


Important considerations when uploading the File Upload System in PHP and MySQL to an Internet hosting

The file to modify with the database credentials is the .env, from line 42 to 47, in this section you must put the username, password and name of the database.

In addition to the final URL of the project, it must be put as it will be in the following document App/Config/App.php on line 27.

Finally, to modify the user's view, the page as it is seen, you can do it from the file called home.php inside the Views folder, in this instance you can modify what the end user sees.

If you have additional questions about the process, you can see the following tutorial where I explain how to upload a PHP application to a hosting:

Upload page with PHP + Database (MYSQL) to a Hosting

I am available for any query.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *