Translate

In this Tutorial, We are going to show you how to store file name into the database and upload into a folder.
First of all, we have to create database named testing using the PHPmyadmin database panel.

1). After creating database, Now need to create one table named "file_storage_table".

CREATE TABLE IF NOT EXISTS `file_storage_table` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filename` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

2). After creating the table, create one folder called "file_upload" and keep files into www folder or htdocs folder.

www or htdocs
– file_upload

3). Create folder with named 'store' into the file_upload folder- and set permission like 777 for store folder (Given Permission - Read, Write, Execution)

www or htdocs
– file_upload
– store

4). Now here is the time to create PHP files into the file_upload folder for execution.

www or htdocs
– file_upload
– store
- index.php
- database_conn.php
– upload.php

In the Index.php file Write the below code exactly it is written.

Simple File upload using php
select File:

database_conn.php
Create Database connection for execution of code.


upload.php
Storing file name into the database and uploading file into store folder.


If you still facing any problem then feel free to Query us with through Contact Us form.

Don't forget to send feedback.
Happy Coding....

0 comments:

Post a Comment

 
Top