Home / Web Development / HTML / Basic File Uploading Using PHP

Basic File Uploading Using PHP

Hi Guys,
In this article we are going to move How to upload the file using PHP. File uploading is mainly done to website like recruting sites, online applications etc. In recrutment site, the user upload their biodata, photo are uploaded through frond end and in here it connect to database also. But now we focus only how to upload the file to specific folder in php. The file uploading is very simple and easy to understand the process in php.

Table Of content

  1. The HTML
  2. The PHP

For uploading a file to specific folder contain only two part: html and php.

The HTML

The HTML parts are used in here for specify form,input and submit button in html for uploading operations. We use enctype=”multipart/form-data”helps to upload files in php. And input type=”file” to specify the type of input tag.

  1. Method=”POST” : it should be POST.
  2. enctype=”multipart/form-data” : it’s specify content-type to be uploaded.
  3. type=”file” : attribute of the input tag shows input field as a file selector with a “Browse” Button.

The PHP

In php part,

  1. $folder: Specify directory for uploading files. In here uploaded_files is the folder to upload file in php.
  2. move_uploaded_files : php function that moves selected file to the specified folder.

Full Code

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Leave a Reply

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

Social Media Auto Publish Powered By : XYZScripts.com