upload()

Description

Uploads images synchronously. The selected image data in DcsBuffer will be encoded according to the value of encodeParameter and uploaded to the specified HTTP server.

Syntax

func upload (indices:[Any], uploadConfig:DcsHttpUploadConfig, encodeParameter:DcsEncodeParameter)

Parameters

indices:[Any] An index array for images to be uploaded.
uploadConfig:DcsHttpUploadConfig Configuration for HTTP upload.
encodeParameter:DcsEncodeParameter Its value will be chosen from DcsPNGEncodeParameter, DcsJPEGEncodeParameter or DcsPDFEncodeParameter which represents to save the images as PNG, JPG or PDF files.

Return value

Data

Remarks

encodeParameter Maximum Value Result if the value exceeds the maximum value
DcsPNGEncodeParameter 1 Upload the first image as PNG file.
DcsJPEGEncodeParameter 1 Upload the first image as JPG file.
DcsPDFEncodeParameter no limit Upload the images as a multi-page PDF.

Exceptions

Circumstance Exception thrown
License verification failed. DcsLicenseVerificationFailedException
Upload fails due to the network issue. DcsHttpErrorException
No network connection. DcsNetworkUnconnectException
Indices/encodeParameter/file is nil. DcsValueNotValidException
Indices include a value not smaller than DcsBuffer.count. DcsValueOutOfRangeException