Skip to Content
0
Apr 27, 2009 at 12:50 PM

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

119 Views

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