UNPKG

react-native-fetch-blob

Version:

A module provides upload, download, and files access API. Supports file stream read/write for process large files.

26 lines (19 loc) 574 B
// Copyright 2016 wkh237@github. All rights reserved. // Use of this source code is governed by a MIT-style license that can be // found in the LICENSE file. import fs from '../fs.js' import Blob from './Blob.js' export default class File extends Blob { name : string = ''; static build(name:string, data:any, cType:string):Promise<File> { return new Promise((resolve, reject) => { new File(data, cType).onCreated((f) => { f.name = name resolve(f) }) }) } constructor(data:any , cType:string) { super(data, cType) } }