官术网_书友最值得收藏!

Cloud Storage

Any mobile or web app will need a storage space that stores user-generated content such as documents, photos, or videos in a secure manner and scales well. Cloud Storage is designed with the same requirement in mind and helps you easily store and serve user-generated content. It provides a robust streaming mechanism for a best end-user experience.

Here's how we can configure Firebase Cloud Storage:

// Configuration for your app
// TODO: Replace with your project's config object
var config = {
apiKey: '<your-api-key>',
authDomain: '<your-auth-domain>',
databaseURL: '<your-database-url>',
storageBucket: '<your-storage-bucket>'
};
firebase.initializeApp(config);
// Get a reference to the storage service
var storage = firebase.storage();
// Points to the root reference
var storageRef = storage.ref();

// Points to 'images'
var imagesRef = storageRef.child('images');

// Points to 'images/sprite.jpg'
// Note that you can use variables to create child values
var fileName = 'sprite.jpg';
var spaceRef = imagesRef.child(fileName);

// File path is 'images/sprite.jpg'
var path = spaceRef.fullPath

// File name is 'sprite.jpg'
var name = spaceRef.name

// Points to 'images'
var imagesRef = spaceRef.parent;
The total length of reference.fullPath must be between 1 and 1,024 bytes, with no Carriage Return or Line Feed characters.
Avoid using #, [, ], *, or ?, as these do not work well with other tools such as Firebase Realtime Database.
主站蜘蛛池模板: 玉环县| 关岭| 陆河县| 宜兰市| 济阳县| 天全县| 久治县| 龙游县| 青铜峡市| 大悟县| 阳泉市| 准格尔旗| 惠东县| 商丘市| 福清市| 武定县| 三穗县| 桦南县| 武平县| 莲花县| 无锡市| 巩义市| 桂东县| 高安市| 通辽市| 永济市| 成安县| 马公市| 镇巴县| 永胜县| 广宗县| 马山县| 永泰县| 铜川市| 政和县| 紫阳县| 巫山县| 门头沟区| 安西县| 哈巴河县| 获嘉县|