cancel
Showing results for 
Search instead for 
Did you mean: 

Perform a FileDownload

Former Member
0 Kudos

Hi,

Is it possible to execute a FileDownload programmatically?

When a user clicks on the link, the FileDowload is executed (works fine). But is it possible, for example, perform a FileDowload form a button?

Thanks,

Ricard.

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Hi,

It certainly can be done, but you have to take care yourself of the mime type, file extension, etc.

First you create a WDWebResourceType based on these properties, then generate an URL to the resulting resource by constructing a WDDeployableObjectPart and retrieving the URL of the resulting IWDResource, and then create a non modal external window using this url

Answers (1)

Answers (1)

former_member182534
Active Participant
0 Kudos

Hi Ricard,

If the file you want to download is available in you context then you can write the following code to download it on your button

wdContext.current<node>Element().get<Attribute>().download();

Regards

Piyas