firebase-admin.storage package

Firebase용 Cloud Storage

Functions

함수 설명
getDownloadURL(파일) 지정된 File의 다운로드 URL을 가져옵니다.
getStorage(앱) 기본 앱 또는 특정 앱의 Storage 서비스를 가져옵니다.getStorage()는 기본 앱의 Storage 서비스에 액세스하기 위한 인수 없이 호출하거나 getStorage(app)로 호출하여 특정 앱과 연결된 Storage 서비스에 액세스할 수 있습니다.

클래스

클래스 설명
스토리지 제공된 앱이 없는 경우 기본 Storage 서비스 또는 제공된 앱과 연결된 Storage 서비스입니다.

getDownloadURL(파일)

지정된 File의 다운로드 URL을 가져옵니다.

서명:

export declare function getDownloadURL(file: File): Promise<string>;

매개변수

매개변수 유형 설명
파일 파일

반환:

프로미스<string>

// Get the downloadUrl for a given file ref
const storage = getStorage();
const myRef = ref(storage, 'images/mountains.jpg');
const downloadUrl = await getDownloadURL(myRef);

getStorage(앱)

기본 앱 또는 특정 앱의 Storage 서비스를 가져옵니다.

getStorage()는 기본 앱의 Storage 서비스에 액세스하기 위한 인수 없이 호출하거나 getStorage(app)로 호출하여 특정 앱과 연결된 Storage 서비스에 액세스할 수 있습니다.

서명:

export declare function getStorage(app?: App): Storage;

매개변수

매개변수 유형 설명

반환:

스토리지

예 1

// Get the Storage service for the default app
const defaultStorage = getStorage();

예 2

// Get the Storage service for a given app
const otherStorage = getStorage(otherApp);