Calling event address

Home > HD Application > Example 2

Explanation

Since the DEXTUploadX5 HD application program is a standalone program first, it is designed to be excluded the communication function of providing an event generated by the program to the browser except the basic operation of registering an item to be downloaded. Instead, it is possible to send a GET request to a specific address on the server each time an item is downloaded from the program. Since the event address uses a method for setting each item, it may provide a different request for each item. If the call is not desired, do not define the property or set to an empty string.

var dx = dx5.get("component-id");

// You can set the event address using the eventUriStart, eventUriStop, and eventUriEnd properties.
dx.addVirtualFile({ 
	... 
	name: "bridge_509147.jpg", 
	url: "...",
	eventUriStart: "http://.../hdevent-start.do?vindex=...&...",
	eventUriStop: "http://.../hdevent-stop.do?vindex=...&...",
	eventUriEnd: "http://.../hdevent-end.do?vindex=...&..."
});

The difference of each property is as follows.

Event if the request sent to the event address fails, the next operation is not affected. If the call to the eventUriStart address is a 404 response, the file download continues as is. In addition, the example only sends the request to the server's event address, but does not provide a way to check the results of the request. To ensure that the request goes to the server correctly, you should record the request in server-side code or look in debug mode.

Example

Generally, all virtual files are targeted for downloading, and the url property of the virtual file is targeted for downloading.