cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving Zero byte Zip file while using "File DownLoad" UI Element

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

My application is trying to download a zip file from the network path when I deploy and run from the server.

(For ex:////sharedfolder/somefolder/out.zip). Server have access to the path.

Please refer the steps here:

1. Created an "File DownLoad" UI element on the view

2. Created a resource type context element called "DownloadZip (Type is ...IWDResource)" (I am trying to download a zip file from network path (//Server/somefolder/out.zip))

3. Binded File DownLoad UI element to "DownloadZip" element

4. Typical Code

IWDResource resource = WDResourceFactory.createResource(

new FileInputStream(new File(////sharedfolder/somefolder/)),

out.zip,

WDWebResourceType.UNKNOWN,

true);

5.Binding to the context attribute

wdContext.currentContextElement().setDownloadZip(resource);

Result: I am able to see file download dialogue. when I say "Save" it stores a Zip file with 0 bytes in it.

However this zip in the network path has 4 MB in it. while downloading this becomes ZERO bytes.

My feeling is that: We need to write a code to read the contents in the network ZIP file, before setting it to the context element( in the step 5) of the type resource above. If So, How I can write ?

If anybody know this scenario, Please help with code samples of this last step.

Thanks

Praveen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi praveen,

Refer this link step by step procedure is there,

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081...

Regards,

Sunaina Reddy T

praveenkumar_kadi
Active Contributor
0 Kudos

Anybody got this issue or know this issue, Please respond.

Thanks

Praveen

Former Member
0 Kudos

Hi Praveen,

You need to read the file using InputStream and then store the Binary value in a variable so that you can pass it to the meod for creating the resource.

Hope this helps!!

Cheers,

Arafat