I\'m trying to upload a file to my server But the problem is the if(isset($_FILES[\'upl\'])) always returns false
my php:
if($_SERVER[\'REQUEST_METHO
You are missing
enctype="multipart/form-data"
in the form
<form action="" method="post" enctype="multipart/form-data">
Very important attribute when uploading files is the enctype
:
<form action="" method="post" enctype="multipart/form-data">
You missed enctype parameter in your from attributes. Its not necessary if you used GET method for file uploading. But if you used POST method for file uploading then, your form parameter should be like this,
<form method="post" action="upload.php" enctype="multipart/form-data">
For file upload, you need to add attribute:
enctype="multipart/form-data"
So, your updated code should be:
<form action="" method="post" enctype="multipart/form-data">
you should add the attribute enctype="multipart/form-data" in form tag to upload the file into server....
You need to change
<form action="" method="post">
to
<form action="" method="post" enctype="multipart/form-data">