What are you trying to upload?
Music? Video? Image?
You should upload the file (whatever type) to a directory on your webserver,
and save the location of the file into the database.
<form enctype="multipart/form-data" action="UPLOADSCRIPT.php" method="POST">
<label for="name">Name</label>
<input type="text" name="name" id="name" class="txt" /><br/>
<input type="hidden" name="_upload_check" value="1"/>
<input type="hidden" name="MAX_FILE_SIZE" value="100000000000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
UPLOADSCRIPT.PHP:
if (array_key_exists('_upload_check', $_POST)){
$name = $_POST['name'];
$target_path = "PATH_ON_YOUR_SERVER";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
mysql_query("INSERT INTO TABLE_NAME (name, location) VALUES ('$name', '$target_path')");
}
else{
echo "ERROR"
}
}
To display the uploaded file you would just use an SQL query to retrieve the name and location. If it was an image you would just use
<img src="DATABASE LOCATION VARIABLE"/>"
Hope that helps.
Its not a secure method though.