Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4619280
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:24:10+00:00 2026-05-22T02:24:10+00:00

Hello I will try my best to explain my problem and I really hope

  • 0

Hello
I will try my best to explain my problem and I really hope someone can figure out what could be wrong.

Situation:

Using the office open XML format by microsoft I was able to create the files needed for a clean Word document. These files are all XML files. What I do is write the XML content to a different bytearray for each file.

I then add the bytearray’s to the FZIP library (http://codeazur.com.br/lab/fzip/) and create a docx file using the following code:

var zip:FZip = new FZip();
zip.addFile("/_rels/", null, false);
        zip.addFile("/docProps/", null, false);
        zip.addFile("/word/", null, false);

        zip.addFile("[Content_Types].xml", bytContentType, false);
        zip.addFile("/docProps/app.xml", bytApp, false);
        zip.addFile("/docProps/core.xml", bytCore, false);
        zip.addFile("/word/document.xml", bytDocument, false);
        zip.addFile("/word/fontTable.xml", bytFontTable, false);
        zip.addFile("/word/settings.xml", bytSettings, false);
        zip.addFile("/word/webSettings.xml", bytWebSettings, false);
        zip.addFile("/_rels/.rels", bytRels, false);

        var file:File = File.documentsDirectory;
        file = file.resolvePath(folder + ".docx");
        var stream:FileStream = new FileStream();
        stream.open(file, FileMode.WRITE);
        zip.serialize(stream);
        stream.close();

Ok this creates a new docx file in my documents. If I rename the .docx to .zip and unzip it it will follow the exact structure needed for Word documents (example: http://dl.dropbox.com/u/5490354/Screen%20shot%202011-05-08%20at%2019.40.10.png)
In this example “Untitled Document” was originally “Untitled document.docx” (then renamed to .zip and extracted)

So you can see everything works fine untill… you try to open the “Untitled document.docx” in Word. It will say the file is corrupt.

WHAT DOES WORK HOWEVER…
After extracting the docx file (like in screenshot) when you select all the files/folders inside the Untitled Document folder and ZIP those, then rename ZIP file to docx (see result: http://dl.dropbox.com/u/5490354/Screen%20shot%202011-05-08%20at%2019.44.18.png) it works fine in Word and word reads the file correctly. NOTE: If you try to zip and rename the Untitled Document folder again it will become corrupt again as well.

So my question
I hope the description was clear and now I am hoping for someone who knows what could be the problem that the word file is corrupt when zipped using FZIP in actionscript 3 but works fine when you ZIP the files after extracting your corrupt file.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:24:10+00:00Added an answer on May 22, 2026 at 2:24 am

    I found the solution to the problem. It was an honest mistake but an annoying one

    zip.addFile("/docProps/app.xml", bytApp, false);
    

    Should be

    zip.addFile("docProps/app.xml", bytApp, false);
    

    Same on all other addFile elements (the first slash needs to be removed)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will try to explain shortly what my problem is... I'm loading an XML
Hello I have a question that could seem complicated. But I will try to
Hello I am trying to figure out how to make it so when someone
I can't figure out how to properly add a static libcurl library to my
Every Hello has a response. Second TTY will send a hello to the sender
I've read that compound primary keys will confuse the hell out of typical ORM
Hello can anybody solve this please I'm creating the object in the action class
Hello all you helpful folks @ stackoverflow! Best resources for Java GUI's? Looking at
Will both catch blocks be hit? try { DoSomething(); } catch (AuthenticationException e) {
hello i got a problem with reading from a file, i am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.