ZIP File has damaged contents - Multiple file download

Hi,
I am using ZIP API in Web Dynpro JAVA for multiple file download scenario.
Issue:--->
Some files are not opening correctly after unzipping the ZIP file.
Example-1: some PDF files gives out message that " "
Example-2: Also, a JPG file shows only upper half of the image.
So in all, the content of generated ZIP file are damaged.
Any idea why this is happening?
Thanks & regards,
Amey

And this is the code I'm using:-
Unzipped PDF files give this error --> There was an error opening this document. The file is damaged and could not be repaired
for(int i = 0; i < l_int_NodeSize; i++){
     g_SearchOutputEle = g_SearchOutputNode.getCtx_vn_SearchOutputElementAt(i);
     java.net.URL url = new URL(g_SearchOutputEle.getFileUrl());
     java.net.URLConnection urlConnection = url.openConnection();
     java.io.InputStream inputStream = url.openStream();
     int arraySize = urlConnection.getContentLength();
     byte[] byteArray = new byte[arraySize];
     DataInputStream dis = new DataInputStream(inputStream);
     dis.read(byteArray);
     ZipEntry zipEntry = new ZipEntry("Name-"+i);
     zipEntry.setSize(byteArray.length);
     zos.putNextEntry(zipEntry);
     zos.write(byteArray);
     zos.closeEntry();
zos.close();
byte[] byteOutArray = baos.toByteArray();
IWDResource resource = WDResourceFactory.createResource(byteOutArray, "Downloads.zip",WDWebResourceType.UNKNOWN);
String urlString = resource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal());
IWDWindow win_MultiFileWindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlString);
win_MultiFileWindow.setWindowSize(0,0);
win_MultiFileWindow.show();
Edited by: Amey Mogare on Mar 30, 2010 7:49 AM

Similar Messages

  • When downloading, why do I get a message saying "Safari cant open file because the file has moved since it was downloaded?"  I just attempted to download the file from a website.  Thanks.

    When downloading from a website, I get a message that says, "Safari cant open th file--- because the file has been moved since you downloaded it.  How do I correct this problem.  It wont let me open attachments from yahoo email either.  Thanks.

    EDIT:
    After posting I see this question has the tag of "windows". I don't know if this applies to the Windows version or not.
    The only time I see this message is if I download something, trash it, AND empty the trash. If I don't empty the trash, it finds it there. It will find it wherever I move it to, unless it is was in the trash and emptied.
    Using Finder, is the downloaded file in your Downloads folder?
    Maybe if you go to Safari/Preferences/General and change the location for downloads to something else then change it back to Downloads it might correct it.

  • Filer warning of creating multiple files even though only one is created

    I'm using the Apt tool with a custom program that I wrote to autogenerate some Java classes for my project. Unfortunately, the Filer is throwing a warning. Even thought the below code is only called once, I get a multiple create warning. Any ideas what's causing this?
    Mark McKay
    Filer filer = env.getFiler();
    PrintWriter pw = filer.createSourceFile(indexClassName);
    warning: Attempt to create 'C:\dev\cvs.kitfox.com\scarlet\gen\com\kitfox\scarlet\\Index.java' multiple times

    I disocvered that this error was coming from the fact that my processor was being called twice - once for my original soruce files, and then again to process the file I had just generated. Once I handled the case of the reentrant call to process(), I was able to avlid this warning.

  • Lightroom 1.3 "Sidecar file has conflict" on .PSD files...

    I've got some .psd files that I changed in Lightroom - they're layered photoshop files, saved with maximize compatibility. The change is to keywords on these files. At present I have about a dozen (that I know of) that appear NOT to be able to update their metadata. The error that displays when I put the mouse on the image's metadata icon is "Sidecar file has conflict".....
    Mayhap I'm missing something, but there are no sidecar files that I know of. They're PHOTOSHOP files, not RAW. The only change to these files in Lightroom was to add, delete, or alter one or more keywords. Other files write metadata successfully, but these fail. How do I get LR to fix this?

    Don, not that I'm doubting your statement, and in truth I can't recall whether or not there were jpegs with the same name, but if having a jpeg with the same filename causes this kind of problem, isn't that pretty much the definition of a BUG? Again, this seems a pretty major problem, although I suppose if it only happens occasionally and the people affected don't mind losing their changes, its no big deal...

  • I'm new to itunes and need some help. Can anyone tell me if it is possible to download an album which has explicit content without actually downloading the explicit songs?

    I'm new to itunes and need some help.  Can anyone tell me if it is possible to download an album which has explicit songs without actually downloading the songs that are explicit?

    See if there's a non-explicit version and download that?  Just download the individual songs you want, and not the others?
    Honestly, your phrasing doesn't make sense.  You're asking how to download an album without downloading its tracks? 

  • THE INSTALLER FILE IS DAMAGED, HOW CAN I DOWNLOAD A TRIAL

    I AM TRYING TO DOWNLOAD A TRIAL OF DREAMWEAVER AND PHOTOSHOP AND I GET AN INSTALLER IS DAMAGED

    See if downloading the trials from the page linked below works better for you.  Be sure to follow the Very Important Instructions shown on that page.
    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • My iTunes library data file has been renamed temp file.tmp

    Can I just rename it iTunes Library? It is a functioning iTunes Database file and it works perfectly well - it is just weird!
    I have iTunes 7.6.2 (9).
    My library resides on my external hard drive.
    In my iTunes folder on that drive, I also find Temp file.tmp.xml and iTunes Library.xml.
    I believe this got screwed up on May 31st (that is the last modified date on iTunes Library.xml) when I was showing a slide show in iPhoto which used music from my iTunes library. At one point I disconnected the external drive to use the USB cable to upload photos to iPhoto from another camera.
    I have read through a lot of the discussion topics about library issues and temp files, but cannot find anything that deals with this issue to answer my question.
    Thanks to anyone who can help.

    Never mind.
    I copied it and renamed it and all is well.

  • HT4753 The old "save as" is missing.  How do I file one document in multiple files?

    With Lion there is no "save as" so how can I file a document in two locations?
    Also, how can I label and file a screen shot as a J-peg?
    Thanks for the help.

    Duplicate and save the duplicate where you want to.
    Open screen shot in Preview > name & save as jpg (double click it, should open in preview automatically)

  • Keep file names when opening multiple files as animation

    Hi, i use fireworks when creating huge amount of photo
    resizing/cropping, where i need to manualy choose the cropping and
    size according to orientation /Horiz. vs Vert./ - i think that
    batch processing is not a good option.
    So, i use open as animation option in open dialog, i have all
    images (+-100) in frames. Is it some way to keep filenames in Frame
    Names, without need to do it by hand? Couse then i can export all
    images in one click.

    quote:
    Originally posted by:
    igraq
    Hi, i use fireworks when creating huge amount of photo
    resizing/cropping, where i need to manualy choose the cropping and
    size according to orientation /Horiz. vs Vert./ - i think that
    batch processing is not a good option.
    You can set up a batch process without having to enter those
    values manually all the time. Do the steps once, on one image only,
    and record the procedure in a custom command. Then call your custom
    command from the batch process as usual. Fireworks will perform
    your recorded steps on the rest of the images while you can sit
    back and relax. ;-)
    And like Darrel wrote above, using percentages will make
    image orientation irrelevant.
    For further details about custom-made commands, you can check
    this
    tutorial.

  • Portlet backing file vs content backing file

    Hi,
    could someone explain the differences between a "portlet backing file" and a "content backing file". Both are properties available on a portlet.
    Thx
    Emmanuel

    According to the documentation, here is the difference:
    Scoping and Backing Files
    The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
    For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
    See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
    Brad

  • Downloaded files from Firefox, opens temporary file instead of the new downloaded file?

    I have downloaded the same (but updated over time) file from dropbox many time. But when i try to download the updated version, Ecxel opens a temporary file. I know this, because i'm sure the file has been updated since last download, and when i download the file in another browser, i shows the file, with the new changes.
    Only Firefox seems to have the problem. How do i force Firefox to use the new download, and not a temporary file?
    Firefox is fully updated, and running on Windows 7 64 bit.

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Air File is Damaged

    Hi,
    Went to start Adobe Acrobat and it won't start, pops up with I need to update Air first. But when you click to update, an error is reported that "the air file is damaged."
    So I downloaded the latest Air from Adobe.com and ran install, no problems installing it. However, the error is still reported when starting Acrobat.
    So I used Windows Control Panel to uninstall Air, and reinstalled it, all went OK again.
    But Acrobat still won't start, the popup appears saying Air must be updated, followed by "the air file is damaged."  I also tried uninstalling then installing Air from the C:/programs/adobe folder since some others on boards say that worked. Didn't work for me.
    I've tried calling Adobe tech support, on the phone 1 hour waiting with no one answering, before I ran out of time and had to hang up. I tried calling a second time, and after anotherr hour of waiting, ran out of time again.
    I suspect the problem is due to a recent auto update from Adobe? My system was running fine on Windows 7 since last year, and there have been no real changes on my PC. It's just recently that Acrobat won't work. Adobe Media Player is running fine, and I know it uses AIR, so I suspect Air is working ok.
    I'm running CS4 Web Premium and Adobe Premiere Pro CS4 on Windows 7, no issues until this Air bug popped up. I do recall getting a recent Adobe auto-update though.
    Any suggestions on what to try next?
    Jonathan, developer
    AtlantaWebDesignGA.com

    After 5 months without an answer I no longer have any interest in it. Thanks anyway.

  • Hi I am looking for a way to have trace32 open multiple files on remote computers

    Simply put I am looking for someone who could afford to give me a basic script (vbs) that I could run from an elevated command prompt. It would need to be available for me to type in the name of a remote computer or (mulitple if possible) and also
    allow me to choose log files to open or multiple files and then open them using trace 32. Hopefully it would detect the available log files and show me what is available to choose to open... anyone know of such a thing or know how to go about setting up something
    like this for people to use?
    EDIT
    I was able to create a basic script to do what I wanted but I want to be able to add wildcards for the rollover logs... Can someone suggest the easiest way to do that as I am not sure how to add the wildcards directly before the .log
    here is the script.
    ' ******Created by Luis Delgado*********
    'This script will get a remote computers .log files depending on which documents you enter in the "files to open on remote computer using trace32" section
    'Get and open log files on remote Computer
    on error resume next
    Set WshShell = Wscript.CreateObject("Wscript.Shell")
    strcomputer   = inputbox("Enter remote computer name or leave as localhost for this computer","Get log files from a remote computer with Trace32","Localhost")
    If strComputer = "" Then
      WScript.Quit
    End If
    'Opens trace32
    wshShell.run "C:\Program Files\ConfigMgr 2007 Toolkit\CCM Tools\Trace32.exe"
    'Files to open on remote computer using trace32
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\datatransferservice.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\ccmexec.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\locationservices.log"
    !!!!NOTE!!!
    What I need is for any file that starts with datatransferservices, ccmexec, or locationservices to open in trace32
    my thought would be place a wild card in its respective spots but it does not work see below
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\datatransferservice*.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\ccmexec*.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\locationservices*.log"

    The roll over logs all have the same name exact the extension is .lo_ , So.. I'm not sure what you are looking for.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • How to add a field for multiple file upload in WebApps ?

    I am creating a WebApp for user to save some information with multiple pitcures. I can only see a single uploader.
    How can I add multiple image uploader and How can I create a custom file upload field rather than image upload ?

    Hi,
    There's no other upload field type for web apps.  You'll need to use the "image file type" to apply multiple file upload fields within the web app form in this case.
    Kind regards,
    -Sidney

  • Sending multiple files

    in file to file. i am sending multiple file with different file name and in target side the same file names should be displayed.help me how to solve problem

    Hi,
    In recevier communication channel we have advanced tab, asam properties we have enable that file name.
    try {
    String filename    = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    filename = conf1.get(key1);
    filename = filename".xml";
    conf1.put(key1,filename);
    return filename;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    regards,
    ganesh.

Maybe you are looking for