Hints
For file uploading process two things are important.
1) enctype should be multipart/form-data.
2) method type should be post.
input element has the type file which is giving the interaction in the web UI to select the file from the end-user. Some of the below techiniques are needed while using input type:file.
|
Multiple File Selector Example Template
<html>
<head>
<title></title>
</head>
<body>
<form action="upload" method="post" enctype="multipart/form-data">
<label for="file_photo">Photo:</label>
<input type="file" name="file_photo" id="file_photo" multiple><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
|
Accept type in input[type=file]
<html>
<head>
<title></title>
</head>
<body>
<form action="upload" method="post" enctype="multipart/form-data">
<label for="file_photo">Photo:</label>
<input type="file" name="file_photo" id="file_photo" multiple accept="image/gif, image/jpeg"><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
|
<html>
<head>
<title></title>
</head>
<body>
<form action="upload" method="post" enctype="multipart/form-data">
<label for="file_photo">Photo:</label>
<input type="file" name="file_photo" id="file_photo"><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
|