spacer

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

home / web / dev / upload / html file

HTML File Upload

Java Developer (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume
Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans


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


The Network for Technology Professionals

Search:

About Internet.com

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

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger

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

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