0

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.

Jaimin
  • 171
  • 1
  • 1
  • 11

1 Answers1

0

I tried to change php.ini from wamp server icon in task bar. It wasn't working in my case. So I tried to change each and every php.ini files in my wamp folder. I don't know but it worked for me. I solved my issue.

Jaimin
  • 171
  • 1
  • 1
  • 11