File Upload dialog using PHP and HTML
File upload allows visitors to specify a file on the browser’s system and submit it to the Web server. This is a useful feature for interactive Web sites.
To present an input field on your Web page to allow users to specify a local file to upload, the
<INPUT TYPE="FILE" ...>
tag is used inside a
<FORM ...>
tag. The
<INPUT TYPE="FILE" ...>
will be displayed as a text input field followed by a “browse” button. Users can either enter the full path name of a local file, or click Browse button to go through a dialog box to select a file interactively.
Example code:
<?php print("<html><form>\n"); print("<input type=file>\n"); print("<input type=submit>\n"); print("</form></html>\n"); ?>
Filed Under: PHP File Handling