Class

BaseProvider

(private) @adminjs/upload~BaseProvider(bucket)

Constructor

# private new BaseProvider(bucket)

Parameters:
Name Type Description
bucket string

place where files should be stored

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 13

Classes

BaseProvider

Members

# bucket

Bucket is a place where files should be stored. Usually it is a folder location

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 23

string

# bucket

Bucket is a place where files should be stored. Usually it is a folder location

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 85

# name

Name is used to verify if the object passed by UploadOptions#provider is

this type. We cannot check typeof because there could be a different versions of npm package installed in a project.

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 19

string

# name

Name is used to verify if the object passed by UploadOptions#provider is

this type. We cannot check typeof because there could be a different versions of npm package installed in a project.

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 79

Methods

# async abstract delete(key, bucket, context) → {Promise.<any>}

Deletes given file
Parameters:
Name Type Description
key string

file path

bucket string

where file should be uploaded

context ActionContext

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 117

Promise.<any>

# async abstract path(key, bucket, context) → {Promise.<string>|string}

Returns path for the file from where it can be downloaded. It is dynamic in case of

time based paths: i.e. link valid in the next 24h

Parameters:
Name Type Description
key string

file path

bucket string

where file should be put

context ActionContext

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 131

Promise.<string> | string

# async abstract upload(file, key, context) → {Promise.<any>}

Uploads file to given bucket
Parameters:
Name Type Description
file UploadedFile

uploaded by AdminJS file

key string

file path

context ActionContext

View Source adminjs-upload/src/features/upload-file/providers/base-provider.ts, line 104

Promise.<any>