Hantu Hazirah

Greenhorn
+ Follow
since Mar 15, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hantu Hazirah

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?
7 years ago
PHP