Files ...

Contact details

Lecture

https://github.com/nirgeier/HTML5Files_NPAPI

Twitter

@nirgeier

Email

nirgeier@gmail.com
Agenda

Today - A short preview of files api

  1. File API (Read)

    Introduction to HTML5 file API

  2. FileSystem API (Read/Write)

    Introduction to HTML5 fileSystem API

  3. NPAPI (Steal files ... )

    [not part of W3C ]
    Full Access to any file on the client HD

File API » Features

File API features

* File System API extends this API (Write → FileWriter)

File API » Objects

File API Objects

The File API spec provides a standard way to interact with local files.

API Objects:

File API » Objects

File API - Flow

File API » Objects

File API - FileReader (Methods)

FileReader includes four options for reading a file, asynchronously:

File API » Objects

File API - FileReader (Events)

File API » Code

File API - Code

<input type="file" id="..." name="..." multiple webkitdirectory/>


        // Add the event listener to the input type="file"
        document.querySelector('#id').addEventListener('change',
            function(e){
                var i, files;

                // FileList object. list of the selected files
                files = e.target.files;

                // Extract the information we can from the files/folder
                for (i = 0, f; f = files[i]; i++) {
                    // f.name
                    // f.type
                    // f.size
                    // f.lastModifiedDate.toLocaleDateString()
                }
                ...
            }, false);
    
File API » Code

File API - Demos

FileSystemAPI

FileSystemAPI


www.nirgeier.com/html5Fest/fileSystemAPI.html
NPAPI

NPAPI - Demo


/