I have created a file which will upload file to wamp server. Code for html and php files are below.
<form action="uploadToServer.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="uploaded_file" id="uploaded_file">
<input type="submit" value="Upload Image" name="submit">
</form>
code for php file.
$file_path = "../uploads/";
$file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
echo "success";
} else{
echo "fail";
}
Problem: When I try to upload file less than 3MB, this code works perfectly. But when I try to upload file more than 3MB, it shows error like : Notice: Undefined index: uploaded_file in C:\wamp\www\whatshare\include\uploadToServer.php on line 4
and Notice: Undefined index: uploaded_file in C:\wamp\www\whatshare\include\uploadToServer.php on line 5
I tried to increase php variables but still it doesn't work. Please help me. Thanks in advance.