Changing options

Home > HD application > Example 03

Explanation

DEXTUploadX5 You can check the default option information of the HD application or change the option.

To check the options of the HD application, use the getOptionsOfHD method, which is a JSON object given as a parameter to the success callback function.

{
	// If the file is added, the HD program automatically activates.
	autoActivation: true,
	// If the file is added, the HD program automatically starts to download. 
	autoDownload: true,
	// If a file is deleted, its temporary file will be deleted too.
	deleteTemporary: false,
	// If some files are being stopped downloading, they will be started to download when the HD program activates.
	resumeDownload: true,
	// Options that is maintained even if the program is closed
	saveStatus: {
		// waiting or stopped item
		waitStop: true,
		// the item that is been downloading
		downloading: true,
		// the item that completed
		complete: true,
		// the item that occurred some error
		error: true
	}
}

Conversely, when setting options, you can set the major options individually, or you can set them at once with the above JSON object. All the methods used to set the options call the success callback function when the configuration is successfully completed.

// Set individual activation options
// Set auto-activation options.
dx.setAutoActivationOptionOfHD(true, function () { ... });
// Set the auto-download option.
dx.setAutoDownloadOptionOfHD(true, function () { ... });
// Set the delete-temporaries option.
dx.setDeleteTemporaryOptionOfHD(false, function () { ... });
// Set the re-download option. 
dx.setResumeDownloadOptionOfHD(true, function () { ... });
// Set the item to be maintained.
dx.setSaveStatusOptionOfHD(15, function () { ... });
// At once
dx.setOptionsOfHD({
	autoActivation: true,
	autoDownload: true,
	deleteTemporary: false,
	resumeDownload: true,
	saveStatus: {
		waitStop: true,
		downloading: true,
		complete: true,
		error: true
	}
}, function () { ... });

The setSaveStatusOptionOfHD method is set to none = 0, waitStop = 1, downloading = 2, complete = 4, and error = 8. To set multiple values ​​at the same time, set the sum of objects (1 to 15). For example, if you want to keep only waitStop and complete objects, you can set 5 (= waitStop + complete) as the parameter value.

Example

Default options

Option to save state values