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?
Your buns are mine! But you can have this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop