How to upload any files extension in our database
Ex.(.doc,.txt,mp4,mp3 etc.)in php
Answer / rajasekhar
It is so simple
first take a form to upload any extension file, your self
if($_POST['submit'] == 'submit')
$filename = $_FILES['file']['name'];
$tmpname = $_FILES['file']['tmp_name'];
$source = "upload/"; // this is a
folder in our server or system
$distination = "upload/".$filename; // we are
uploading file in to our created folder
if($_FILES['file']['error'] == false)
// using sql we are upload file name into database,
$sql = mysql_query("insert into file set filename =
echo "file uploaded to database successfully";
echo "Unable to upload file to database. ".mysql_error();
// Retriveing file from that database
$sql = mysql_query("select * from file");
$res = mysql_fetch_array();
<form name="frm" action="<?php $_SERVER['PHP_SELF']; ?>"
<input type="file" name="file" /><input type="submit"
name="submit" value="submit" />
|Is This Answer Correct ?||3 Yes||3 No|
How can we extract string 'techinterviews.com' from a string 'http://www.techinterviews.com' using regular expression in PHP?
Explain what is smarty?
How do you match the character ^ at the beginning of the string? - ^^
What is ci in php?
What is the basic function to search files for lines (or other units of text) that contain a pattern.
How many Types of COmments are there in PHP and what are they?
What is mod_php?
Php says that an array is an ordered map. But how the values are ordered in an array?
What is mysqli php?
how to run PHP in command line?
Why do we use query?