参考 p5.File

p5.File

A class to describe a file.

p5.File objects are used by myElement.drop() and created by createFileInput.

示例

语法

p5.File(file)

参数

file
File:

wrapped file.

字段

file

Underlying File object. All File properties and methods are accessible.

type

The file MIME type as a string.

For example, 'image' and 'text' are both MIME types.

subtype

The file subtype as a string.

For example, a file with an 'image' MIME type may have a subtype such as png or jpeg.

name

The file name as a string.

size

The number of bytes in the file.

data

A string containing the file's data.

Data can be either image data, text contents, or a parsed object in the case of JSON and p5.XML objects.

Notice any errors or typos? Please let us know. Please feel free to edit src/dom/dom.js and open a pull request!

相关参考