Hello everyone! I am a php newbie and still learning.
I made a simple upload form in php. This is my code.
It works fine. But if I press the submit with no files attached, it displays the error, Warning: file_get_contents(): Filename cannot be empty in C:\xampp\htdocs\contractdb\filetest.php on line 20 .
I want uploading files to be optional because not every user has the files to attach. I also want the user to download the files after uploading (if they do upload files) without removing file_get_contents($_FILES['upload']['tmp_name']).
How do I do this?