cpr.controls.UploadedFile
File object used in file upload
Index
| Name |
Type |
Description |
| lastModified |
Number |
Returns the last modification time of the file as the millisecond difference from UNIX time (midnight on January 1, 1970). |
| name |
String |
Returns the name of the file referenced by the File object. |
| size |
Number |
Returns the size of File in bytes. |
| type |
String |
Returns the MIME type of File. |
| Name |
Return Type |
Description |
| arrayBuffer |
Promise<ArrayBuffer> |
Convert the File to a stream and read it to the end. |
| getProperty |
Object |
Returns the set property value. |
| slice |
Blob |
Returns a new Blob object containing data for the specified byte range from the source blob. |
| stream |
ReadableStream<Object> |
Convert File to ReadableStream. |
| text |
Promise<String> |
Convert the File to a stream and read it to the end. |
Constructor
| name |
type |
description |
| properties
|
{
name?: String,
size?: Number,
lastModified?: Number,
type?: String,
properties?: {[key:string]: Object}
} |
|
Properties
| type
|
Number |
| readonly
|
Returns the last modification time of the file as the millisecond difference from UNIX time (midnight on January 1, 1970).
|
| type
|
String |
| readonly
|
Returns the name of the file referenced by the File object.
|
| type
|
Number |
| readonly
|
Returns the size of File in bytes.
|
| type
|
String |
| readonly
|
Returns the MIME type of File.
|
Methods
Convert the File to a stream and read it to the end. Returns a Promise that transitions to an ArrayBuffer.
| return
|
Promise<ArrayBuffer> |
|
Returns the set property value.
| name |
type |
description |
| name
|
String |
|
Returns a new Blob object containing data for the specified byte range from the source blob.
| name |
type |
description |
| startoptional
|
Number |
|
| endoptional
|
Number |
|
| contentTypeoptional
|
String |
|
Convert File to ReadableStream. ReadableStream can be used to read the contents of a file.
| return
|
ReadableStream<Object> |
|
Convert the File to a stream and read it to the end. Returns a Promise that fulfills as a USVString.