Multimedia File

Posted on Updated on

463px-Multimedia_neededHow to upload multimedia file by php?

We are normally upload text by the input type text but if we want to  upload the media file we are use input type file which Is use for upload any kind and any size of the file and can access by using the database. Mostly websites are based on images and works on images like shopping sites social site we are use to upload images and videos .

 The question is come how can we upload the file??

 When we declare the form we write into the form

 Enctype=”multipart/form-data”

 Eg.

Its open  a upload window and we can select and upload the file when clicked.

 Now we open the file and select which file we want to upload the file and then we get the name of the

 file with help of php code.

 $_FILES[‘file_name’][‘name’];

 It will get the name of the file and we can store the file name into the database.we can get the file size and we can get the file type.

 How to get the file type and file size:

 $_FILES[‘filename’][‘size’];

 $_FILES[‘filename’][‘type’];

Now we get the name of the file and store the file name into the database now the next step is move the file from the user end to the server folder and how it is works??

 Just write the code in php

 Move_uploaded_file($_FILES[‘tmp_name’][‘name’],”folder_name/”.$_FILES[‘filename’][‘name’]);

 A single line upload the file into the folder Keep it in mind you have to create a folder into the server which is same name as we define in move_upload_file.

 Now we can upload the file the next step is when we delete the file it must be deleted form the database as well as from folder.

 That time we are use unlink function.

 Syntax:unlink(“folder_name/”.filename);

For more details and queries please feel free to email, visit or call us. Wishing you the very best for all your future endeavors.

Helpline: 9814666333, 8699444666

Email:info@technocampus.co.in

**************************************************************************************************************

Please fill the FORM and we shall contact you soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s