I've been using PHP upload file into MySQL database. But I noticed that I can only upload files not exceeding 6MB.
How can I increase the upload size? Up to what size am I able to upload file?
Below is my PHP file.
index.php
<?php
mysql_connect("127.0.0.1","Localhost"," ");
mysql_select_db("uploadfile");
if(isset($_POST['submit']))
{
$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
move_uploaded_file($temp,"uploaded/".$name);
$url = "http://127.0.0.1/file/uploaded/$name";
mysql_query("INSERT INTO `file` VALUE ('','$name','$url')");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>File Upload</title>
</head>
<body>
<a href="file.php">Show File</a>
<form action="index.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" name="submit" value="Upload!" />
</form>
<?php
if(isset($_POST['submit']))
{
echo "<br />".$name." has been uploaded";
}
?>
</body>
</html>
file.php
<?php
mysql_connect("127.0.0.1","Localhost"," ");
mysql_select_db("uploadfile");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>File Upload</title>
</head>
<body>
<?php
$query = mysql_query("SELECT * FROM `file`");
while($row = mysql_fetch_assoc($query))
{
$id = $row['id'];
$name = $row['name'];
echo "<a href='watch.php?id=$id'>$name</a><br />";
}
?>
</body>
</html>