Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IUploadConfig

Hierarchy

  • IUploadConfig

Index

Properties

getFileToken: ((fileType: FileType, fileName?: string, httpMethod?: "POST" | "PUT", queryString?: string, url?: string) => Promise<IUploadAuth & { bos: string; qiniu: string; ossConfig: string }>)

Type declaration

    • (fileType: FileType, fileName?: string, httpMethod?: "POST" | "PUT", queryString?: string, url?: string): Promise<IUploadAuth & { bos: string; qiniu: string; ossConfig: string }>
    • 获取存储服务鉴权信息

      description

      httpMethodqueryString 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:

      1. 开始分段前调用,此时 httpMethod 值应为 POSTqueryString 值为 uploads
      2. 上传请求前调用,此时 httpMethod 值应为 PUTqueryString 值为 partNumber={partamNumer}&uploadId={uploadId}
      3. 上传结束前调用,此时 httpMethod 值应为 POSTqueryString 值为 uploadId={uploadId}

      Parameters

      • fileType: FileType

        文件类型

      • Optional fileName: string

        文件名称

      • Optional httpMethod: "POST" | "PUT"

        STC 分段上传时的必填参数,有效值为 PUT | POST

      • Optional queryString: string

        STC 分段上传时的查询字符串

      • Optional url: string

      Returns Promise<IUploadAuth & { bos: string; qiniu: string; ossConfig: string }>

getFileUrl: ((fileType: FileType, fileName?: string, saveName?: string, uploadRes?: { isBosRes: boolean; downloadUrl: string }, serverType?: UploadMethod) => Promise<{ downloadUrl: string }>)

Type declaration

    • (fileType: FileType, fileName?: string, saveName?: string, uploadRes?: { isBosRes: boolean; downloadUrl: string }, serverType?: UploadMethod): Promise<{ downloadUrl: string }>
    • 获取 七牛、百度、阿里云 上传成功可下载的 URL

      Parameters

      • fileType: FileType

        文件类型

      • Optional fileName: string

        文件名

      • Optional saveName: string

        下载后的存储文件名

      • Optional uploadRes: { isBosRes: boolean; downloadUrl: string }

        插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取

        • isBosRes: boolean
        • downloadUrl: string
      • serverType: UploadMethod = UploadMethod.QINIU

        使用的存储服务标识

      Returns Promise<{ downloadUrl: string }>

customDomain: string
serverType?: number
ossConfig?: string
uploadServer?: string
bosAddr?: string