Skip to main content

Dealing with Local Files Using the File API

  • Chapter
Book cover HTML5 Programming for ASP.NET Developers
  • 1341 Accesses

Abstract

It’s a well-known fact that for the sake of security and privacy, browsers don’t allow web applications to tamper with the local file system. Local files are used in a web application only when the user decides to upload them to the server using the HTML <input> element of type file. The title of this chapter may surprise you at first, because the term File API gives the impression of being a full-blown file-system manipulation object model like the System.IO namespace of .NET Framework. Obviously, the people behind HTML5 are aware of the security issues such an object model can create. So, the File API is essentially a cut-down version of a file-handling system in which files can only be read and can’t be modified or deleted. Additionally, the File API can’t read any random file on the machine. File(s) to be read must be explicitly supplied by the user. Thus, the File API is a safe way to read and optionally upload local files with user consent.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Bipin Joshi

About this chapter

Cite this chapter

Joshi, B. (2012). Dealing with Local Files Using the File API. In: HTML5 Programming for ASP.NET Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4720-3_9

Download citation

Publish with us

Policies and ethics