Options
All
  • Public
  • Public/Protected
  • All
Menu

Module upload

Index

Functions

Const uploadFolderToPrefix

  • uploadFolderToPrefix(bucket: string, prefix: string, folder: string, searchStr?: string): Promise<UploadObjectsResponse>
  • Upload all files for a given folder (just root files) and store them into a S3 bucket under a prefix

    Parameters

    • bucket: string

      AWS S3 bucket where the object will be stored

    • prefix: string

      Prefix where the objects will be under

    • folder: string

      Local folder path where files are stored

    • searchStr: string = ".*"

      A match string to select all the files to upload, by default ".*".

    Returns Promise<UploadObjectsResponse>

Const uploadObject

  • uploadObject(bucket: string, key: string, localFilename: string): Promise<string>
  • Upload one file from local disk and store into AWS S3 bucket

    Parameters

    • bucket: string

      S3 bucket where the object is stored

    • key: string

      S3 key where the object is referenced

    • localFilename: string

      S3 destination bucket

    Returns Promise<string>

    • The S3 full URL to the file

Const uploadObjects

  • uploadObjects(bucket: string, objects: UploadObjectsData[]): Promise<UploadObjectsResponse>
  • Upload list of files to specific objects

    Parameters

    • bucket: string

      AWS S3 bucket where the objects will be stored

    • objects: UploadObjectsData[]

      List with objects containing local path to be uploaded and S3 key destination

    Returns Promise<UploadObjectsResponse>

Generated using TypeDoc