spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / dev / upload / html file

HTML File Upload

Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?


Uploading Images using HTML and ASP

In which we discover the hidden wonders of HTML file uploads.

The HTML file upload form element is standard, but vastly underused. It allows you to create forms that can send entire files to your Web server. As a visitor it appears as just another part of just another form. You click on the file upload button to choose a file. When you submit the form the file is posted along with the rest of the form data.

Like so many useful elements of HTML, file upload was not supported in Internet Explorer 3.0 but was soon afterwards added in version 3.02. It is available in Netscape Navigator from version 2.02 onwards.

So what does it look like? Well check out the (non-functional) form below - pretty much like any other form element except that you can use the browse button to choose files.

Enter Some Text:

Choose a File:


What about the code? Well again, pretty much like any other piece of form HTML. Here's the code for the above.

<form method="post" action="photoupload.asp" name="submit" enctype="multipart/form-data">

Enter Some Text: <input type="text" name="textfield"><br><br>

Choose A File: <input type="file" name="filefield"><br><br>

<input type="submit" name="su bmit" value="submit"><br>

</form>

There are only a couple of real differences. The input type of the file upload is 'file' rather than 'text.' The 'enctype' of the form is 'multipart/form-data' - about which more of later.


Comments are welcome

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

Created: Aug. 19, 1999
Revised: Aug. 19, 1999

URL: http://webreference.com/dev/upload/htmlfile.html