Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourYellow
title릴리즈 2.10.0 이상

파일 업로드를 위한 사용자 함수를 설정합니다. 이 함수가 설정되어 있으면 내부 파일 업로드 로직을 이용하지 않고 지정된 사용자 함수를 호출합니다.

Parameters:

Name

Type

Description

funcFunction

파일 업로드에 사용될 사용자 함수

Example:

Code Block
languagejs
themeEmacs
function customUpload(file, fileType) {
    // 파일 업로드 처리
    return url;
}

editor.setCustomUploadFunction(customUpload);

사용자 함수의 정의

사용자 업로드함수는 아래와 같이 정의되어야 합니다.

Parameters:

Name

Type

Description

fileFile

에디터를 통해 업로드할 파일

fileTypeString파일 타입 (image, video, file)

Return:

Type

Description

String브라우저에서 접근 가능한 URL 또는 Path

중요) 사용자정의 업로드 함수에서는 파일 업로드 후 반스시 업로드된 파일에 접근 할 수 있는 URL(또는 Path)을 반환해야 합니다.

Example:

Code Block
languagejs
themeEmacs
function customUpload(file, fileType) {
    // 파일 업로드 처리
    return url;
}