Skip to Content
HTML5, JavaScript, and jQuery 24-Hour Trainer
book

HTML5, JavaScript, and jQuery 24-Hour Trainer

by Dane Cameron
February 2015
Intermediate to advanced
408 pages
9h 41m
English
Wrox
Content preview from HTML5, JavaScript, and jQuery 24-Hour Trainer

Lesson 34

Files

Files and file systems have always been one of the most important concepts in computing because they provide a convenient mechanism for providing input to, and storing output from, computer software.

Despite this, browsers have been extremely limited in the manner they can interact with files or the file system. This interaction has been limited to the file input type, which can be declared as follows:

<input type="file" name="selectedFile"/>

This creates an input type that allows a file to be selected from the file system. For instance, in Chrome, the input field appears as you see in Figure 34.2, while in Firefox, the input type appears as you see in Figure 34.1.

image

Figure 34.1

image

Figure 34.2

Once a file is selected, its content will be submitted to the web server when the form is submitted: The file contents can then be accessed by the web server and processed.

Despite its simplicity, the file input type is extremely important to HTML, and many of the most popular sites on the Internet could not exist without it. Any time you select a file from ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Realtime Web Apps: With HTML5 WebSocket, PHP, and jQuery

Realtime Web Apps: With HTML5 WebSocket, PHP, and jQuery

Jason Lengstorf, Phil Leggetter
jQuery in Action, Third Edition

jQuery in Action, Third Edition

Aurelio De Rosa, Yehuda Katz, Bear Bibeault

Publisher Resources

ISBN: 9781119001171Purchase book