I am submitting files via this way, inside of a form (with a submit button, form tags, etc):
<fieldset>
<input type="file" name="file" />
</fieldset>
And I am trying to pull it/use it with PHP this way:
$file = $orgname."/".basename($_FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'], $file);
And I am getting these errors:
Notice: Undefined index: file in C:\wamp\www\generic\addorg.php on line 45
Notice: Undefined index: file in C:\wamp\www\generic\addorg.php on line 46
What could be causing this? Everything I've looked into suggests it should work.
form needs to be set enctype=multipart/form-data
Make sure your <form...
specifies enctype="multipart/form-data">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With