Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

blob?: File

JavaScript file object.

Note: it is recommended that you use this parameter to take information such as the file name extension,

Note 2: Only one of the fileInput, file, filePath, and blob is required.

commonUpload?: boolean

Whether to use standard upload.

Note: The default setting false, the uploaded in fragments. The standard upload limit is 100MB in size. If the host environment does not support fragment upload, it will automatically changes to the standard upload.

fileInput?: string | HTMLInputElement

DOM node or node ID of an Input[type=file] element.

Note: browser-specific, the SDK will read the first selected file under this node, please do not operate the file under this node before the upload is complete.

Note 2: Only one of the fileInput, file, filePath, and blob is required.

filePath?: string

Temporary file path

Note: React Native, Mini Program and other special JS runtime environments (the temporary path obtained by chooseImage)

Note 2: Only one of the fileInput, file, filePath, and blob is required.

maxSize?: number

size limit of a file in bytes.

Note: For mini programs, React Native apps and other environments, since there is only filePath without specific file information, this field cannot be used to evaluate the file size, you must evaluate the file size on your own.

nosScene?: string

Notes:

  • For common scenarios, set the storage scenario according to the resource type, and set the scheduled task to delete files.
  • The default storage scenarios for IM: 'im'
  • The default storage scenarios for chat room: 'chatroom'

Storage scene priority

  • nosScene parameter for sendFile or previewFile
  • the nosScene parameter for initialization
  • Default value: 'im' or 'chatroom'

Secure links for on-premises applications

  • generate secure links for on-premises applications, set nosScene: '_nim_security'
  • The recipient uses getNosAccessToken to obtain a link with authentication information
  • Authentication information using deleteNosAccessToken is invalid.
nosSurvivalTime?: number

The validity period of uploaded files stored on NetEase Object Storage (NOS).

notice

default value: Infinity (permanent). The time must not be less than one day, unit: seconds.

type: "video" | "audio" | "image" | "file"

File type, image, video, audio, and file.

Methods

  • Upload progress callback

    Note: Internet Explorer 9 and earlier version do not support the upload progress event, so the callback fails.

    Parameters

    Returns void

  • Callback for upload progress

    Note: The upload progress event is not supported on browsers earlier than IE9, so the callback is invalid.

    Parameters

    Returns void