Help:  unable to open files created with ZipOutputStream

I am seeing some weird behavior with ZipOutputStream, using JDK 1.3.1_01 on Win2K. The code that follows is a snippet from a servlet that delivers a ZIP archive of a set an entire directory tree. I was preparing to roll it into production, but one of my testers noticed a bug that I didn't see.
It seems that her version of WinZip (6.x) was unable to properly extract the files from the archive while mine (8.0) had no problems. I then tried a couple of other programs, and I've been able to reproduce the behavior with the built-in viewer in Lotus Notes 5 (the only other utility I had handy).
I've made sure to call closeEntry() on each ZipEntry, and to call finish() before close() on the ZipOutputStream itself. Has anyone seen this behavior besides me?
Thanks and regards,
Casey
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
    response.setContentType("application/zip");
    response.setHeader("Content-Disposition","attachment; filename=\"package.zip\"");
    File dir = new File(m_templateDir);
    ZipOutputStream out = new ZipOutputStream(response.getOutputStream());
    addFilesToPackage(dir, "", out);
    out.finish();
    out.close();
// Recursively walks the directory, adds files to the output stream,
// and calls itself to handle sub-directories
private void addFilesToPackage(File dir, String pathPrefix, ZipOutputStream out)
throws IOException {
    File[] list = dir.listFiles();
    for (int k=0; k<list.length; k++) {
        File f = list[k];
        if (f.isDirectory()) {
            addFilesToPackage(f, pathPrefix + f.getName() + "/", out);
        } else {
            ZipEntry ze = new ZipEntry(pathPrefix + f.getName());
            out.putNextEntry(ze);
            InputStream in new FileInputStream(f);
            byte[] buff = new byte[2056];
            int bytesRead = 0;
            while((bytesRead = in.read(buff)) > -1) {
                out.write(buff, 0, bytesRead);
            out.closeEntry();
            in.close();
}

I had also a problem with W2K when using ZipInputStream, I could not to solve it.
so I used Unpacked Streams.
weird indeed.
Sometimes it works just fine.
FileInputStream fis;
byte [] in;
//ZipFile zf = new ZipFile(new File("data/products.zip"));
//ZipEntry ze = zf.getEntry("products.wsl");
//fis =new BufferedInputStream( zf.getInputStrea(ze));
fis = new FileInputStream("data/products.wsl");
koko = fis.available();
in = new byte[koko];
fis.read(in);
fis.close();
I think code was something like abowe (there has been a while...)

Similar Messages

  • After Effects CS6 connot open files created with CC 12.1 Mac version

    After Effects CS6 connot open files created with CC 12.1 Mac version. Is there an update?
    I am running Windows 7 Pro and Adobe CS6 Suite with all updates

    You are never able to open projects from one version of After Effects in an earlier version. This has always been the case.
    You can use the command File > Save As > Save A Copy As CS6 to save a version of the project from After Effects CC (12) that can be opened in After Effects CS6 (11).

  • Unable to open pdf created with Acrobat Pro using Adobe Reader X

    Files created with some Adobe Professional applications such as Acrobat Pro ensure the file is small by excluding font information from the file.  Simple pdf creation applications embed the font in the file, which makes for transportability between apps but does make the files big.
    The problem i have experienced is that Adobe Reader X is one of the simple app varieties, so is unable to open, print, or read files created using Adobe Acrobat Pro..
    i'd welcome any help in (a) finding a free app that opens these 'pro pdf' files, OR (b) an option setting in Acrobat Pro which includes the font information in the file - or both!

    There are so many things wrong, around a tiny grain of truth, it really isn't worth examining. Not at this stage if you are more interested in getting things working.  It may be worth asking you though, since Reader doesn't even launch for you, how you came to focus on font embedding being the cause.
    Ok, Reader doesn't launch. Suppose you start Reader FIRST. Then use File > Open on your PDF.

  • Logic will not open files created with earlier versions?

    Logic Pro 9 will not open willnot open files created in earlier versions advising that attempts should be mad using Logic pro 7.  My Mac Pro wil not open this version of Logic "because PowerPC applkcations are no longer supported."  Any help would be very much appreciated since I need to have books reprinted.
    Thanks

    Pancenter wrote:
    Won't help, the "installer" (through Logic 8) uses some PPC code, this person is running Lion which means no version of 7 or 8 can be installed.
    Hi
    I think that the PPC installer can be worked around (?):
    Make disk images of the Install Disks, mount them all, then use Pacifist to run the Install process
    Looks like it should work here..
    CCT

  • Unable to open file created by outbound file adapter

    Hi,
    I have a requiement for polling data from 3 different tables, mergind=g them and writing all data into a flat file in CSV format. However, I see that I'm unable to open the file with my personal UNIX credentials, since the file is getting written by the SOA UNIX credentials.
    Is there any way to set the default permissions on the server so that the file is accessible to other users as well.
    Any insight would be appreciated, I'm quite stumped with this. My working environment is SOA Suite 11.1.1.5 running on OEL 5
    Thanks,
    Debojit

    Hi,
    In my view this can be sorted out at a operational system level, if you set 'umask 2' for the SOA user (the user that is starting the SOA servers and writing the files) then files created by that user will allow rights for users in the same group. So, you will need to add the group id from the SOA user to your user groups.
    It may be a little bit confusing, the link bellow explain how permissions work in a Unix system.
    Understanding file permissions on Unix: a brief tutorial
    http://www.dartmouth.edu/~rc/help/faq/permissions.html
    Cheers,
    Vlad

  • PCs unable to open PDFs created with Mac

    Hello! I do hope this is the correct place for this question.
    I spent most of last night taking some InDesign documents, saving them as PDFs, uploading them to my website and letting my customers know they are on the website for the taking.
    I have heard from several people today that they are unable to open the files. Only those with Macs have been able to. I have read online and in my Mac books and have been unable to determine what the problem could be.
    Any ideas would be most welcome!
    Powerbook   Mac OS X (10.4)  

    Hi Lesley!
    Since I don't know how you're creating your HTML code (coding by hand or using an application) I can't offer any advice for how to correct your problem, however I can help you with troubleshooting.
    Most web browsers have a "status bar" feature that will show you what's contained in a link. I used Firefox and the status bar is enable by choosing View menu --> Status Bar. In Safari you'll choose View menu --> Show Status Bar. With this enabled, hover your mouse over a link an you'll be able to see the link at the bottom of the browser window.
    The link I saw in the Status Bar had two HTTP strings running together. I was able to view the PDF by removing the first HTTP string.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.7)  

  • Unable to open files associated with Adobe Reader - program goes into a loop

    i am unable to open any file associated with adobe reader or adobe pro.  when i double-click the file, adobe reader opens up but it goes into a loop. 
    adobe reader opens, then a progress window opens, as if the file will open but adobe closes and opens again and the same cycle repeats itself until i manually close the program.
    any advice?
    update:
    i can open regular .PDF files when i double-click the icon and i can also open .PDF files when i open adobe reader first and then choose open file.  it's just the .FDF files that are the problem (so far).
    the file in question happens to be an .FDF extension, which is an internet generated form. i attached a screen shot of the screen that pops up, goes away, and pops up again that creates the loop.
    the white out section is the server name where the file was saved to.  but i also get the same symptoms when i am in internet explorer, hit the generate form button.

    hey ankit,
    sorry i didn't see a notification that you replied to this discussion.
    "1. Generate a new PDF and a FDF file. Try opening the same and see if it behaves the same way."
    yes, it does behave the same way, it's just a continuous loop until i have to kill the process.
    "2. Check if you have access to the PDF that is being used by the particular FDF."
    by this do you mean the correct permissions?  if that is what you mean, then yes, the permissions are set correctly.
    "3. If possible, please send me the FDF and the associated PDF that is behaving in this way on your system."
    i really wish i could but the information in the form is sensitive and cannot be sent. 
    as an update though, i reimaged the customer's workstation, installed Adobe Reader 10.1.1 and it worked perfectly (finally).  HOWEVER, after about two weeks the same symptoms returned! 

  • Unable to open iPhoto-- created with unreleased version?

    Hi,
    The other day I had to do a hard reset on my laptop after it froze while trying to come out of sleep mode (black screen, frozen mouse pointer).
    After I restarted & launched iPhoto (5.0.4) I get this message: "This photo library was created with an unreleased version of iPhoto. Please quit and upgrade this library by opening it in iPhoto 2 or iPhoto 4." Quit is my only option.
    I tried installing iPhoto 4 but it wouldn't let me.
    Simultaneously, my iTunes 8 library became damaged and I had to re-import all of my music... I've lost all of my playlists, iPhone Apps & all but one TV Show, but Movies & Podcasts are still there.
    I booted my laptop from the system disk & repaired my harddrive, then repaired permissions as well. Problem persists.
    Someone on a forum had suggested using iPhoto Library Manager, but when I launched it I get the message: "The album data file for this library is malformed. Conversion of data failed. The file is not UTF-8, or in the encoding specified in XML header if XML."
    On a side note, I noticed that the AlbumData.xml file had changed to a Final Cut Pro icon. (I've since changed it to Open With iPhoto)
    It seems like my photos are still on my harddrive... is there a way to open iPhoto without referencing my old library, then re-import my photos? Also, worried that this little crash will mess up syncing with my iPhone...
    Any help would be greatly appreciated. Thanks!

    Jordan,
    Your iPhoto database was damaged in the crash. Since iPhoto Library Manager can't fix it, you need to create a new library and start from scratch. This [Apple article|http://support.apple.com/kb/HT2042?viewlocale=en_US] has instructions for performing a manual rebuild. You might also read [these instructions by lori_diloreto|http://discussions.apple.com/thread.jspa?messageID=1853164] which pertain specifically to an iPhoto 5 library. The results will differ, but her post gives a clear explanation of what to expect if you use that method.
    On the other hand, if you have a recent backup copy of the iPhoto Library folder from before the crash, you can replace your damaged iPhoto Library folder with the backup to get back to that previous state. Rename and move the broken one first so you don't overwrite it or delete it until you are ready.
    Regards.

  • How to open file created with TextEdit on Mac?

    I created a text file using TextEdit on my MacBook Air then saved it to iCloud. Now I would like to read the file from my iPhone. I've got apps that read text files, but they can't see this file. How can I find the file and open it?

    Hi,
    Do u mean to say that u need to open another PLD in when ur user form is open.?
    Please provide more information.
    Thanks,
    Vasu Natari.

  • Can't open files created in CS3 with CS4

    When I try to open a file that was created in CS3 I get this message:
    Cannot open the file "OpenEnrollSample.indd". Adobe InDesign may not suport the file format, a plug-in that supports the file format may be issing, or the file may be open in another application.
    This goes for both the InDesign files and the PDF files created with them. Does anyone have any idea why this is happening? Thanks for any help.

    My Acrobat that is part of CS4 won't open the PDFs created by the CS3 InDesign file.  However, I do have the plugin to open PDFs in InDesign and that doesn't work with these files either.
    These are files I created so I know that they are InDesign files.
    I am running OS 10.6.8 and using CS4.

  • PLEASE HELP! Unable to render any Quicktime format - after effects error unable to open file (-1610153459)

    I just can't render any type of Quicktime file in AE CC 2014. I'm on Windows 8.1.
    Even in CS6 was it not possible, but I never really used any Quicktime filetypes.
    Normally I just rendered to .h264, but now that's only available via the insane slow Adobe Media Encoder, I want to use the Quicktime -> h.264 option, but it's just not possible.
    I also want to render some footage to the Avid DNxHD codec, but this is also not possible.
    Doesn't matter what type of footage, dslr footage, pictures, AE solids. Everytime I want to render in a Quicktime file I get this error:
    AE error: Rendering error while writing to file (File-Location). Unable to open file. (-1610153459)
    Installed the latest Windows version of Quicktime, didn't help...
    I saw some topics about this, but they didn't provide a good solution. All they discussed was the hardware of the computer. I have enough space available and render to a NTFS drive.
    Please can someone help me with this!

    Yes! I just solved my own problem. I still think that the internet doesn't provide an easy to find answer, so I will post this.
    I had the latest version of Quicktime, but this version causes the problem. After some searching I finally found a page on the Apple website that confirms this.
    Updating to QuickTime 7.4 may cause issues while rendering footage in Adobe After Effects - Apple Support
    So I uninstalled my latest version of Quicktime and installed version 7.4.1. Everything works now the way it's supposed to!

  • Unable to open or create file ... Permission denied

    I'm a new user of LC Designer ES.  After creating and saving a form, I made changes and now cannot save.  Error message in Log tab of Report palette says "PDF generated successfully.  Unable to open or create file [file name] Permission denied."  Any ideas why this would happen, and how to fix?
    Thanks for any help.

    If the file is already opened in another application (like Acrobat or Reader) then you wodul not be able to save it as those apps put a lock on the form.
    Paul

  • Last time I updated pages I lost features I liked and was unable to open some pages files.  Now I see the features I liked are back but I have a lot more files to worry about.  Will I be able to open files created in 5.2 if I upgrade to 5.5.3?

    Last time I updated pages I lost features I liked and was unable to open some pages files.  Now I see the features I liked are back but I have a lot more files to worry about.  Will I be able to open files created in 5.2 if I upgrade to 5.5.3?

    Within reason, Pages v5.2 documents are forwards compatible with Pages v5.5.3. Apple introduced the single file format document as a default with Pages v5.5.3 which is not backwards compatible with Pages v5 on Mavericks.
    However, they also provided a File > Advanced > Change File Type > {Single File, Package} menu that allows you to change the current Pages v5.5.3 document into the backwards compatible Package type document. You would follow this transformation with a File > Save operation to complete it.

  • HELP - Partition Error Unable to open file (c:\TEMP\ESS00001.tmp)

    While tryint to create a partion that we have in 5.02p14 to 6.2.1, I receive the error during validation. any ideas?Unable to open file (c:\temp\ess00001.tmp).When I go to c:\temp directory, I can see the files but they are empty.Please Help.Thanks, Paul J.

    we've gotten this message in essbase 5.02 patch 13 when updating the partitions if there was an error when saving. i think it happens because essbase only partially updated the partition definition file so when you try to save it again, it looks for the temp file. the best way i found to fix this is to delete the .ddb (not .dbb) file from both source and target databases. this will delete any partition you already have existing on the database though.

  • Can't open DNG files created with Mac CS5 downloader in Mac CS4 Photoshop

    I recently installed CS5 on my mac but I kept CS4 installed as well.  I notice that I cannot open DNG files created with CS5 in Photoshop CS4.  Bridge CS4 shows the files only as icons - no image thumbnails.  I am able to open these same files on a Windows version of CS4.  Is there some plugin for my mac CS4 that will enable me to access the DNG files created with CS5?  Is there a way to use my CS5 downloader when converting my raw files from my camera to DNG files that will make them compatiple with PS and Bridge CS4?

    rr3rd wrote:
    Is there a way to use my CS5 downloader when converting my raw files from my camera to DNG files that will make them compatiple with PS and Bridge CS4?
    Well, yes...but you'll need to modify your DNG Converter prefs to allow for that. You''ll need a recent (ideally current DNG Converter 6.4.1 or above) and click on the DNG Converter preferences and select the correct DNG Converter options. Check DNG Converter 6.4.1 (the current version) and click on "Change Preferences" to be sure select Camera Raw 5.4 and later then make sure CS4 is updated to ACR 5.7 (which is the last version of ACR for CS4) However, the changes made to ACR 6.x really should be adopted since IQ for ACR 6.4.x is a lot better...

Maybe you are looking for