cancel
Showing results for 
Search instead for 
Did you mean: 

Give a User a Downloadfile without DonloadUI

Former Member
0 Kudos

Hi,

i have created an htmlfile. I want to tranfer this file to the client without any additional Button Or Ui click. The dialog "save as..." or "open with" should come immidiately.

I have an byte[] or  an IWDResource resource filled with data. But what's the next step???

kind regards

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Michael Rudolph wrote:

I have an byte[] or  an IWDResource resource filled with data. But what's the next step???

Hi Michael

Next step would be one of two:

  1. To put a link on your page (implemented by Webdynpro FileDownload widget). User have to click the link and it ill bring the Save As/Open dialog. Just add FileDownload element and map it to your IWDResource in controller's context.
  2. To open a new browser window with URL targeting your binary web-content. You can get URL referring to your resource from the code:

IWDResource webResource;

...

String resourceURL = webResource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal());

IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resourceURL, <window title>);

win.show();

Regards, Siarhei

Answers (2)

Answers (2)

Former Member
0 Kudos

Step 2 solved my problem. Thanks a lot...

Former Member
0 Kudos

Hi,

Just call the download method defined in IWDResource interface. I mean assuming resource is the IWDResource form of the html file then write resource.download( ); to get the save, open popup.

Regards,

Vishweshwara P.K.M.

Former Member
0 Kudos

Hi,

Hi,

i work with NW 7.0 ... so i don't habe any .download() - Method in

 

com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource 😞