Search
    Preparing search index...

    Пользовательский запрос на загрузку

    interface UploadCustomRequestOptions {
        action: string;
        data: object;
        file: RcFile;
        filename: string;
        headers: object;
        onError: (error: Error, response?: any, file?: RcFile) => void;
        onProgress: (event: { percent: number }, file: RcFile) => void;
        onSuccess: (response: object, file: RcFile) => void;
        withCredentials: boolean;
    }
    Index

    Properties

    action: string

    URL-адрес загрузки или конечная точка.

    data: object

    Дополнительные данные, отправляемые в запросе.

    file: RcFile

    Объект файла для загрузки.

    filename: string

    Имя файла в запросе.

    headers: object

    Заголовки HTTP-запроса.

    onError: (error: Error, response?: any, file?: RcFile) => void

    Колбэк, вызываемый при ошибке загрузки.

    Type declaration

      • (error: Error, response?: any, file?: RcFile): void
      • Parameters

        • error: Error

          Объект ошибки.

        • Optionalresponse: any

          Дополнительная информация с сервера.

        • Optionalfile: RcFile

          Загружаемый файл.

        Returns void

    onProgress: (event: { percent: number }, file: RcFile) => void

    Колбэк, вызываемый при обновлении прогресса загрузки.

    Type declaration

      • (event: { percent: number }, file: RcFile): void
      • Parameters

        • event: { percent: number }

          Объект прогресса с текущим процентом.

        • file: RcFile

          Загружаемый файл.

        Returns void

    onSuccess: (response: object, file: RcFile) => void

    Колбэк, вызываемый при успешной загрузке.

    Type declaration

      • (response: object, file: RcFile): void
      • Parameters

        • response: object

          Ответ сервера.

        • file: RcFile

          Загружаемый файл.

        Returns void

    withCredentials: boolean

    Использовать ли учетные данные при запросе.