Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FileUploadService

Index

Constructors

Properties

deferredUpload?: Deferred<FileUploadResult>
fileService: FileService
fileSystemPreferences: FileSystemPreferences
messageService: MessageService
uploadForm: Form
TARGET: string = 'target'
UPLOAD: string = 'upload'

Accessors

  • get maxConcurrentUploads(): number

Methods

  • confirmOverwrite(fileUri: URI): Promise<boolean>
  • createUploadForm(): Form
  • getUploadUrl(): string
  • indexDataTransferItemList(targetUri: URI, items: DataTransferItemList, context: FileUploadService.Context): Promise<void>
  • init(): void
  • registerEvents(target: EventTarget, register: ((unregister: (() => void)) => Record<string, EventListenerOrEventListenerObject>)): void
  • Utility function to attach events and get a callback to unregister those.

    You may not call unregister in the same tick as register is invoked.

    Parameters

    • target: EventTarget
    • register: ((unregister: (() => void)) => Record<string, EventListenerOrEventListenerObject>)
        • (unregister: (() => void)): Record<string, EventListenerOrEventListenerObject>
        • Parameters

          • unregister: (() => void)
              • (): void
              • Returns void

          Returns Record<string, EventListenerOrEventListenerObject>

    Returns void

  • uploadFile(file: File, targetUri: URI, token: CancellationToken, leaveInTemp: undefined | boolean, onProgress: ((total: number, done: number) => void)): { response: Promise<void>; upload: Promise<void> }
  • Parameters

    • file: File
    • targetUri: URI
    • token: CancellationToken
    • leaveInTemp: undefined | boolean
    • onProgress: ((total: number, done: number) => void)
        • (total: number, done: number): void
        • Parameters

          • total: number
          • done: number

          Returns void

    Returns { response: Promise<void>; upload: Promise<void> }

    • response: Promise<void>

      Promise that resolves after the uploading step, once the server answers back.

      Rejects on network error. Rejects if status is not OK (200). Rejects if cancelled.

    • upload: Promise<void>

      Promise that resolves once the uploading is finished.

      Rejects on network error. Rejects if status is not OK (200). Rejects if cancelled.

  • withProgress<T>(cb: ((progress: Progress, token: CancellationToken) => Promise<T>), __namedParameters?: FileUploadProgressParams): Promise<T>