Opening a file

Home > Basic examples > Example 05

Explanation

The DEXTUploadX5 does not provide desktop program execution. Instead, you can open the destination in a new window if the file can be opened with a browser. In general, files that a browser can open are as image-specific.

The openable target must be a virtual file that has the value of the openUrl property.

var dx = dx5.get("component id");
// The download web path must be present in the openUrl property. 
dx.addVirtualFile({ ... name: "bridge_509147.jpg", openUrl: "http://.../service/common-open.ashx?key=FID0001" });

This sample is handled by the generic handler (common-open.ashx).

# Server-side

using (var dext = new DEXTUpload.NET.FileDownload())
{
    dext.Download(path, new DEXTUpload.NET.DownloadOption
    {
        MimeType = "image/jpeg",
        IsInline = true
    });
}

Example