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 17

Members

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 75

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 69

Methods

# async abstract delete(key, bucket, context)

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 40

# async abstract path(key, bucket, context)

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 53

# async abstract upload(file, key, context)

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 29