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

  • SEARCH
  • Home
  • 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 8597965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:02:43+00:00 2026-06-12T01:02:43+00:00

I am trying to save a XAP file witch is basically like a zip

  • 0

I am trying to save a XAP file witch is basically like a zip file, and i can Archive and save it, but it adds to many folders?

I am using Ionic.Zip DLL to Archive my XAP file.

The file saves to my path, but when i open it up it has the folder users, then in there it has the folder Shaun, and in that folder a folder Documents, in the the folder FormValue then in side there it has my 3 files i zipped.

I need the Xap file only to contain the 3 files i zipped and not all the extra folders inside.

using (ZipFile zip = new ZipFile())
{
// add this map to zip
zip.AddFile("C://Users//Shaun//Documents//FormValue//" + property_details_locality_map); 
zip.AddFile("C://Users//Shaun//Documents//FormValue//data.xml");
zip.AddFile("C://Users//Shaun//Documents//FormValue//dvform.dvform"); 
zip.Save("C://Users//Shaun//Documents//FormValue//NewValuation.xap");
}
  • 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-06-12T01:02:44+00:00Added an answer on June 12, 2026 at 1:02 am

    Use the zip.AddFile(string fileName, string directoryPathInArchive) overload and specify the empty string "" for the second parameter:

    zip.AddFile("C://Users//Shaun//Documents//FormValue//" + property_details_locality_map, ""); 
    zip.AddFile("C://Users//Shaun//Documents//FormValue//data.xml", "");
    zip.AddFile("C://Users//Shaun//Documents//FormValue//dvform.dvform", ""); 
    

    From the documentation:

    /// <param name="directoryPathInArchive">
    ///   Specifies a directory path to use to override any path in the fileName.
    ///   This path may, or may not, correspond to a real directory in the current
    ///   filesystem.  If the files within the zip are later extracted, this is the
    ///   path used for the extracted file.  Passing <c>null</c> (<c>Nothing</c> in
    ///   VB) will use the path on the fileName, if any.  Passing the empty string
    ///   ("") will insert the item at the root path within the archive.
    /// </param>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save multiple image using this code. But instead its saving
i am trying to save a file from chrome using AjaxSubmit. i got the
i trying to save this string with a file list into a file but
Im trying to save some data into a xml file using the following PHP
I'm trying to save a bitmap to file and a specific directly using a
I'm trying to save a file at path WindowsFormsApplication1\WindowsFormsApplication1\SaveFile but the following code returning
I'm trying to save a file to a Sharepoint server using JAX-WS. The web
Im trying to save a simple script in netbeans to htdocs, but i only
When trying to save the database using boost serialization, I encounter the segfault that
I'm trying to save some data into an array but unfortunately all the data

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.