Aurigma Image Uploader 5.0 Dual
ImageUploader.UploadThumbnailCompressionMode Property
See Also Supported in: ActiveX Java

Compression mode of the specified thumbnail.

# Syntax

##### Get/Set Value in Runtime

JavaScript | Copy Code
--- | ---
    getImageUploader("ImageUploaderID").setUploadThumbnailCompressionMode(Index, value);
    value = getImageUploader("ImageUploaderID").getUploadThumbnailCompressionMode(Index);

##### Parameters

Index

  A non-negative integer that specifies an index of the upload thumbnail (one-based). It should not exceed `UploadThumbnailCount - 1` . If extra upload thumbnails are required, use the UploadThumbnailAdd method to add them.

##### Property Value

A string value that specifies the compression mode format string of the specified thumbnail.

The compression mode format string consists of `file masks=compression modes` pairs separated by semicolon. Each pair includes the set of file masks and the set of compression modes separated by comma. In general, this string has the following syntax:

`mask11,mask12,...=mode1,mode2,...;mask21,mask22,...=mode1,mode2,...;...`

When Image Uploader prepares a POST request it parses the compression mode format string from beginning to end and extracts `file masks=compression modes` pairs. For each file selected for upload Image Uploade gives the first pair. If it finds the file mask in this pair corresponded to extension of the file, it applies the first appropriate compression mode from the compression set of this pair. Otherwise if no appropriate file mask or compression mode found, Image Uploader checks the next pairs in the same manner.

Image Uploader supports the following compression modes:

Compression Mode | Description
--- | ---
Jpeg | If a file selected for upload is image, Image Uploader resizes this image to the specified dimensions and uploads it as JPEG file. Otherwise if file is non-image, Image Uploader uploads a system icon associated with the file. By default, this mode is applied to any file regardless of its extension. More information about image resizing before upload you can read in the Resizing and Rotating Images topic.
Zip | Image Uploader sends a ZIP archive of the original file.
Icon | Image Uploader sends a system icon associated with a file selected for the upload.
SourceFile | Image Uploader sends the original file.

# Remarks

Image Uploader can generate multiple thumbnails per one file sent to the server. To configure sizes of thumbnails and other parameters, you can manipulate a list of upload thumbnail settings. It can be done two ways:

1. Use `UploadThumbnailNXXX` parameters, where N is a number in range from 1 to 3.
2. Use the UploadThumbnailAdd method in JavaScript to add extra thumbnail sizes, and `UploadThumbnailXXX` properties to change specific settings.

First method is simpler, however it allows to upload not more than 3 thumbnails per one file. The second one does not have any limitation on the number of thumbnails.

To get an upload thumbnail on the server use the `UploadThumbnailX` HTTP POST field, where X is an index of the upload thumbnail.

Note
The index of upload thumbnail list is zero-based. However by default upload thumbnail with zero index is disabled (its fit mode is `Off`).

# See Also

##### Examples

Handling Files Compression
POST Field Reference

##### Reference

UploadThumbnailAdd Method
UploadThumbnailBackgroundColor Property
UploadThumbnailCompressOversizedOnly Property
UploadThumbnailCopyExif Property
UploadThumbnailCopyIptc Property
UploadThumbnailFitMode Property
UploadThumbnailHeight Property
UploadThumbnailJpegQuality Property
UploadThumbnailResizeQuality Property
UploadThumbnailWatermark Property
UploadThumbnailWidth Property