O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Allowing Visitors to Upload Files

Sometimes you might want your users to upload a file, such as a photograph or a résumé, to your server.

Image To allow visitors to upload files, you must set the proper enctype attribute and create the input type="file" element.

<form method="post" action="showform.php" enctype="multipart/form-data">...<label for="picture">Picture:</label><input type="file" id="picture" name="picture" /><p class="instructions">Maximum size of 700k. JPG, GIF, PNG.</p>...</form>

Image The file upload area provides a way for the user to select ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required