IUploaderOptions

types.IUploaderOptions

Type parameters

Name
T

url

url: string | (request: string | IDictionary<string> | FormData) => string

Defined in

src/types/uploader.d.ts#39


insertImageAsBase64URI

insertImageAsBase64URI: boolean

Defined in

src/types/uploader.d.ts#42


imagesExtensions

imagesExtensions: string[]

List of extensions for images

Default

['jpg', 'png', 'jpeg', 'gif']

Example

Jodit.make('#editor', {
  uploader: {
    insertImageAsBase64URI: true,
    imagesExtensions: ['jpg', 'png', 'jpeg', 'gif', 'svg', 'webp']
  }
});
Defined in

src/types/uploader.d.ts#57


headers

Optional headers: null | IDictionary<string> | (this: IAjax<any>) => CanPromise<null | IDictionary<string>>

Defined in

src/types/uploader.d.ts#58


data

data: null | object

Defined in

src/types/uploader.d.ts#62


format

format: string

Defined in

src/types/uploader.d.ts#63


method

method: string

Defined in

src/types/uploader.d.ts#64


filesVariableName

filesVariableName: (i: number) => string

Type declaration

(i): string

Parameters
Name Type
i number
Returns

string

Defined in

src/types/uploader.d.ts#66


pathVariableName

pathVariableName: string

Defined in

src/types/uploader.d.ts#102


withCredentials

withCredentials: boolean

Defined in

src/types/uploader.d.ts#103


prepareData

prepareData: (this: T, formData: FormData) => any

Type declaration

(this, formData): any

Parameters
Name Type
this T
formData FormData
Returns

any

Defined in

src/types/uploader.d.ts#105


buildData

Optional buildData: (this: T, formData: any) => BuildDataResult

Type declaration

(this, formData): BuildDataResult

Parameters
Name Type
this T
formData any
Returns

BuildDataResult

Defined in

src/types/uploader.d.ts#106


queryBuild

Optional queryBuild: (obj: string | FormData | IDictionary<string | object>, prefix?: string) => string | FormData

Type declaration

(obj, prefix?): string | FormData

Parameters
Name Type
obj string | FormData | IDictionary<string | object>
prefix? string
Returns

string | FormData

Defined in

src/types/uploader.d.ts#107


isSuccess

isSuccess: (this: T, resp: IUploaderAnswer) => boolean

Type declaration

(this, resp): boolean

Parameters
Name Type
this T
resp IUploaderAnswer
Returns

boolean

Defined in

src/types/uploader.d.ts#112


getMessage

getMessage: (this: T, resp: IUploaderAnswer) => string

Type declaration

(this, resp): string

Parameters
Name Type
this T
resp IUploaderAnswer
Returns

string

Defined in

src/types/uploader.d.ts#114


process

process: (this: T, resp: IUploaderAnswer) => IUploaderData

Type declaration

(this, resp): IUploaderData

Parameters
Name Type
this T
resp IUploaderAnswer
Returns

IUploaderData

Defined in

src/types/uploader.d.ts#116


error

error: (this: T, e: Error) => void

Type declaration

(this, e): void

Parameters
Name Type
this T
e Error
Returns

void

Defined in

src/types/uploader.d.ts#118


defaultHandlerSuccess

defaultHandlerSuccess: HandlerSuccess

Defined in

src/types/uploader.d.ts#120


defaultHandlerError

defaultHandlerError: HandlerError

Defined in

src/types/uploader.d.ts#121


contentType

contentType: (this: T, requestData: any) => string | false

Type declaration

(this, requestData): string | false

Parameters
Name Type
this T
requestData any
Returns

string | false

Defined in

src/types/uploader.d.ts#123

processFileName

processFileName(this, key, file, name): [string, File, string]

The method can be used to change the name of the uploaded file
This is the name the file will have when it is sent to the server

Jodit.make('#editor', {
 uploader: {
   url: 'some-connector.php',
   processFileName: (key, file, name) => {
     return [key, file, 'some-prefix_' + name];
   }
 }
});

Parameters

Name Type
this T
key string
file File
name string

Returns

[string, File, string]

Defined in

src/types/uploader.d.ts#82


getDisplayName

getDisplayName(this, baseurl, filename): string

The method can be used to change the displayed name of the uploaded file

Jodit.make('#editor', {
  uploader: {
    url: 'https://sitename.net/jodit/connector/index.php?action=fileUpload',
    getDisplayName: (_, name) => 'File:' + name
  }
});

Parameters

Name Type
this T
baseurl string
filename string

Returns

string

Defined in

jodit/src/types/uploader.d.ts:100