Unzip a file

Can anyone of you tell me how to unzip a zip file and copying the contents of the zip file to new directory

A zip file is a sequential list of zip entries (short headers) followed by contents. There is one entry/content pair for each file that is in the .zip file.
You use the ZipFile (this from memory - check the API) class to get an iterator and then loop through the entries. You use a ZipInputStream to pick up the entry as a ZipEntry object. That lets you see file name, path, size, etc. Then you read the contents (into a byte array) from the ZipInuptStream.
From there you can write the bytes (open a new RandomAccessFile and write the byte array with one call, then close) or write a new .zip (ZipOutputStream).

Similar Messages

  • I'm running Firefox 7.0.1 and since the September 30 security update I can no longer unzip zipped files unless I reboot my computer first or run it in Safe Mode. Can anyone help me roll Firefox back to before the update?

    I regularly download zipped files from Survey Monkey. Since the latest security update, the zipped files download to my computer, but when I try and unzip them I get a message telling me the file is in use by another application. If I reboot, I can unzip the file, or if I'm in Safe Mode when I download the file it unzips fine.
    I have tried three different unzip apps and all have the same trouble. Everything was working well after the September 5 update.
    I'm running Windows XP with McAfee antivirus, Spybot, Ad-Aware and Malbytes Anti-malware. All are up to date.

    The URL below is to Adobe's Acrobat update page.
    There you'll find each of the incremental updates to Acrobat 10.
    They must be installed one at a time in sequence. 
      http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows
    Now, if after attempted updates fail then you'll need to speak with your IT Department.
    You need your install of Acrobat 10 updated to dot version 10.1.7.
    Be well...
    Message was edited by: CtDave

  • Easy way to unzip zipped files?

    I'm trying to figure out an easy way to unzip zipped files.  I'm using C# in VS 4.5.
    I download this:
    http://dotnetzip.codeplex.com/
    I couldn't get any dlls installed.  I couldn't set any reference to anything.
    I also tried to follow the example here:
    http://www.danderson.me/posts/zipfile-class-system-io-compression-filesystem/
    I can't find anything titled 'System.IO.Compression.dll'.  I set a reference to these two:
    System.IO.Compression.FileSystem
    System.IO.Compression
    That did nothing at all.
    For instance, I think this should work:
    using System;
    using System.IO;
    using System.IO.Compression;
    namespace ConsoleApplication
    class Program
    static void Main(string[] args)
    string startPath = @"c:\example\start";
    string zipPath = @"c:\example\result.zip";
    string extractPath = @"c:\example\extract";
    ZipFile.CreateFromDirectory(startPath, zipPath);
    ZipFile.ExtractToDirectory(zipPath, extractPath);
    However, i keep getting an error message that says 'The name 'ZipFile' does not exist in the current context'.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hi
    Please include the below namespace and try it out.
    System.IO.Compression.FileSystem
    The code would be like this.
    using System;
    using System.IO;
    namespace ConsoleApplication
    class Program
    static void Main(string[] args)
    string startPath = @"c:\example\start";
    string zipPath = @"c:\example\result.zip";
    string extractPath = @"c:\example\extract";
    System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
    System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extractPath);
    Please note that you need to add a DLL reference to the framework assembly
    System.IO.Compression.FileSystem.dll
    Please let me know in case of any questions you may have around this. Thank you. 

  • Any tcode to unzip a file?

    does any body know any transaction code to unzip a file.
    iam already using a fn module SXPG_CALL_SYSTEM which uses a unix command.
    and i know uncompress in open dataset.
    but i need a transaction code but not the abobve two solutions.

    Don't know of a way to create a Keyboard shortcut since the menu item name changes with whatever is selected, but you could make an Automator script and then map that Automator script to a keyboard shortcut. Or just make a Automator Application that sits on your desktop or dock and drag and drop files onto it.

  • Unzip/ Untar files

    I am remotely logged into a UNIX cluster at the university and attempting to manipulate some files that I have received from a collaborator. He has "tarred" and "zipped" the files. Unzipping the file with the command
    <remote host:directory>% gunzip file.tar.gz
    (remote host is the machine I am logged into (via ssh -X username): directory is my directory on the remote host)
    This creates the unzipped file- file.tar on <remote host:directory>. The problem arises when I attempt to untar the file. I am using the command
    tar -xvfp file.tar
    After entering this command, I get the message
    tar: can't mkdir /net: Permission denied
    tar extract: failed mkdir of <:senders directory>
    The same error is produced using [tar -xvf] as the bundled-options. I am assuming that it is attempting to make the directory on my collaborators remote host because the listed location of the failed mkdir is the senders directory <:senders directory> on a different UNIX cluster.
    I have tried variations on the tar command (-x or -xv) but those produce the error
    tar: tape read error: no tape in drive
    I am a bit unfamiliar with the syntax for the [[-]bundled-options Args] in the tar command, but I suspect that I need to specify where the untarred archive is going to be written/ copied. Could anyone provide some guidance on this.
    Sincerely,
    Aric

    Hi Aric,
       Did you copy the error message verbatim? Does it really want to create the directory, /net? If so then the problem is likely to be in the tarball itself.
       There's nothing wrong with your initial syntax. The -x tells tar to unpack the tarball, which is what you're trying to do. The -p says to preserve permissions, which is fine. The 'p' is not supposed to go after the 'f' in the options because the tarball, file.tar, is technically an argument of the -f option. However, most implementations of tar are rather forgiving in that regard. The -v option simply tells tar to be verbose and list the files. Of course there are many implementations of tar and you don't bother to tell us into what kind of machine you're logged.
       Tar has the ability to archive many files and preserve the directory structure. However, it has to recreate those directories when unpacking and that's when it had a problem. It seems that tar wants to create a directory named "net" at the root of the boot drive. I assume that the creator of the tarball archived such a directory on his machine.
       However, most implementations of tar strip the leading slash, turning an absolute path into a relative path. That way when unpacked, the directory structure starts at the current working directory. Unless you tried to unpack this tarball from the root directory of the boot drive, the tar that created this tarball appears to be different.
       Unless you can get the privilege of writing to the root of this boot drive, I would guess that your only recourse is to get the person who created the tarball to redo it using relative paths. See if you can get him to create it with GNU's tar, as that version strips the leading slashes by default.
    Gary
    ~~~~
       OK, so you're a Ph.D. Just don't touch anything.

  • Problem in unzip a file

    hai,
    Iam trying to unzip a file but its not working.
    //Unzip a file
      final int BUFFER = 2048;
      String zfname=application.getRealPath("/") + "temp/Bulk.zip"; 
           File  zf=new File(zfname);
      try {
             BufferedOutputStream dest = null;
             FileInputStream fis = new FileInputStream(zf);
             ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
             ZipEntry entry;
             while((entry = zis.getNextEntry()) != null)
                                       System.out.println("Extracting: " +entry);
                     int count;
                     byte data[] = new byte[BUFFER];
                    // write the files to the disk
                    File outFile=new File(outPath);
                    //FileOutputStream fos = new FileOutputStream(outFile);
                    FileOutputStream fos = new FileOutputStream(entry.getName());
                    dest = new BufferedOutputStream(fos, BUFFER);
                    while ((count = zis.read(data, 0, BUFFER))!= -1)
                        dest.write(data, 0, count);
                    dest.flush();
                    dest.close();
             zis.close();
          } catch(Exception e) {
             e.printStackTrace();
    Bulk.zip folder has the following files:
    Bulk/test.txt
    Bulk/fm.jsp
    I get the following exception
    java.io.FileNotFoundException: Bulk\test.txt
    (The system cannot find the path specified)
    Iam i making mistake in this line
    FileOutputStream fos = new FileOutputStream(entry.getName());
                    dest = new BufferedOutputStream(fos, BUFFER);Thanks,
    Thanuja.

    ok vijay iam so sorry for not mentioning how i rectified it. somehow i missed it. may be was bit excited when i got the result.
    anyways below code worked.
    //Unzip a file
        String zip_fname=request.getParameter("zfilename")!=null?request.getParameter("zfilename"):"";
        String fromZip=zip_fname;
        //out.println("FromZip:"+fromZip);
        File zipFname=new File(newFileName);
        String toLocation=newFilePath; //path to unzip the file
        String seperator = System.getProperty("file.separator");
        System.out.println("unzipping zip file to "+toLocation);
        try
            BufferedOutputStream dest = null;
            File zipDir = new File(toLocation);
             zipDir.mkdir();
            ZipFile zip = new ZipFile(fromZip);
            final int BUFFER = 2048;
            FileInputStream fin=new FileInputStream(fromZip);
            ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fin));
            ZipEntry entry;
            while((entry = zis.getNextEntry()) != null)
                     //System.out.println("Extracting: " +entry);
                     int count;
                     byte data[] = new byte[BUFFER];
                     String zip_Fname=entry.getName().substring(entry.getName().lastIndexOf("/")+1);
                        if(!zip_Fname.equals(""))
                            zipFiles.add(zip_Fname);
                  if(!zip_Fname.equals(""))  
                     FileOutputStream fos = new FileOutputStream(toLocation + seperator + entry.getName().substring(entry.getName().lastIndexOf("/")+1));
                     dest = new BufferedOutputStream(fos, BUFFER);
                     while ((count = zis.read(data, 0, BUFFER))!= -1)
                        dest.write(data, 0, count);
                    dest.flush();
                    dest.close();
             zis.close();
        catch (Exception ex)
            unZipResult++;
            System.out.println(ex);
        }Thanks,
    Thanuja.

  • Unzip the file

    I need to Unzip a file from Folder 1 and place it in Folder2.
    Folder 1 has a zip file, which a txt file embedded in it. PI need to unzip the file and place the file in Folder2 with same name.
    I have created a Configuration Scenario for this, no IR objects.
    I have used PayloadZipBean with ModuleConfiguration as
    ParameterName- zipmode and ParamterValue - unzip in my sender file channel and same  is used in receiver channel.
    For some reason when I see the payload in sender communication channel log, it is automatically converted to XML with some junk values along with the data.
    Another issue is although I have checked the Adapter Specific Properties on both the channels, it expects a name on Receiver file channel. So I have given a dummy name there. File got created in Folder2 but with some junk values in XML format.
    Any thoughts please.

    Thank You both.
    Greg - your idea worked.
    On the other issue looks like I can not use Adapter Specific Properties on both the channels. when I use ASMA File got created in Folder2 but with some junk values in XML format.
    Looks like it expects a name on Receiver file channel. So I have given a dummy name there.
    Edited by: Vamsi on Feb 23, 2012 6:15 PM

  • Unzip a file preserving the folder structure

    Hi guys,
    I have create a zip file using java.util.zip and I preserv all directory structure. When I unzip the file using the same library, in the loop of ZipEntry I don't find never a directory. This the code that I use and don't work:
    public void dataDecompression(String pathArchivio) {
        try {
            fileInputStream = new FileInputStream(pathArchivio);
           checkedInputStream = new CheckedInputStream(fileInputStream, new Adler32());
           zipInputStream = new ZipInputStream(new BufferedInputStream(checkedInputStream));
           ZipEntry entry;
           while((entry = zipInputStream.getNextEntry()) != null){
                if(entry.isDirectory()){
                     //make dir          
               else{
                    //write file
    }Maybe I miss something in compression? Excuse for my bad english.
    Thanks in advance.

    three problems with that.
    1) you don't recusively create folders.
    2) you create a folder with the name of the file you want to write.
    3) you don't create files.
    File file=new File(entry.getName());
    if(file.getParentFile()!=null);
         file.getParentFile().mkdirs();
    if( !entry.isDirectory() ) {
    //code that write file;

  • Unzip GZ files using Powershell

    I have  Windows 2008 Server with some GZ type files in a folder. I would like to script unzipping them using Powershell, can someone tell me if this is possible and how I would do it?
    The folder is d:\data_files\ and I'd like to uncompress all the .gz files in there
    I've searched around on the Net but can't find much that deals with GZ files specifically. The files are all named data-1.gz, data-2.gz etc
    Hello
    I have  Windows 2008 Server with some GZ type files in a folder. I would like to script unzipping them using Powershell, can someone tell me if this is possible and how I would do it?
    The folder is d:\data_files\ and I'd like to uncompress all the .gz files in there
    I've searched around on the Net but can't find much that deals with GZ files specifically.

    I also found that .Net 2.0 and above has native code for dealing with gzip files.
    Function DeGZip-File{
    Param(
    $infile,
    $outfile = ($infile -replace '\.gz$','')
    $input = New-Object System.IO.FileStream $inFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read)
    $output = New-Object System.IO.FileStream $outFile, ([IO.FileMode]::Create), ([IO.FileAccess]::Write), ([IO.FileShare]::None)
    $gzipStream = New-Object System.IO.Compression.GzipStream $input, ([IO.Compression.CompressionMode]::Decompress)
    $buffer = New-Object byte[](1024)
    while($true){
    $read = $gzipstream.Read($buffer, 0, 1024)
    if ($read -le 0){break}
    $output.Write($buffer, 0, $read)
    $gzipStream.Close()
    $output.Close()
    $input.Close()
    $infile='C:\Temp\DECfpc1new.csv.gz'
    $outfile='c:\temp\DECfpc1new.csv'
    DeGZip-File $infile $outfile
    You can supply the function with the full path of the file to be unzipped, and the full path of the unzipped file.
    If you don't supply the unzipped file path, the function will unzip the file into the same folder as the source, and remove the .gz extension.
    Inspired by Heineken.

  • Problem using payloadZipBean to unzip a file

    I would like to run OS command to zip large amount of xml into one zip file before XI pick it up, then use unzip option in payloadZipBean to unzip all the xml files so XI can process them one by one from memory, this will reduce lots file I/O time.
    But I am getting this warning message:
    Warning Zip: message is empty or has no payload
    But if I display this message in RWB, the only payload is this zip file.
    Why the payloadZipBean is not unzipping this file as supposed to.

    Did you check this blog
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    Sameer

  • Unzip the file archived by the File adapter

    Hi Experts,
    we have a scenario where we are archiving a xml file using the File adapter and also it is being zipped by the OS command.
    the script not only zips the file, it also rename the file from *.zip to *.xml.
    Hence after archiving when I am trying to open it, the content appears to be junk.
    Please suggest how to unzip the file as it got a extension *.xml.
    And I also tried renaming the file to *.zip and then to uncompress, but it shows below error
    Cannot open : it does not appear to be a valid archive
    Thanks in advance,
    MK

    hi Mk,
    instead of using OS command try using the exesting module provided by the SAP, so your job will be easy.
    follow this steps in the module processing for UN ZIP
    Processing sequence:
    Module name: AF_Modules/PayloadZipBean
    Type: Local Enterprise Bean
    Module key: 3
    u2022 Module configuration:
    Module key: 3
    Parameter name: zip.mode
    Parameter value: unzip.
    in the commincation channel specify filename.xml
    so you can open the file in XML format
    Thanks,
    Madhav
    Note:points if useful
    Edited by: madhav poosarla on Aug 14, 2008 8:31 AM

  • NI unzip changes file date and time stamp

    A coworker this morning asked me about the NI-Unzip VI.
    It turns out that when the NI unzip VI unzips a file it changes the file dates to the date the file was unzipped.
    He also noted that NI-Unzip seems to be calling the Windows touch.exe to do this.
    The diagram for NI unzip is locked and password protected so his attemp to change this action blocked.
    Does anyone know a way around this? Either to make the NI Unzip stop changing the file date or the passwork to teh unzip vi?
    Message Edited by RTSLVU on 03-22-2010 08:01 AM

    Hi,
    I don't think NI will give you a password for it's protected functions...
    So you can:
    - use "System Exec" with a command line version of a ZIP tool of your choice to unzip files
    - make your own "Unzip" VI with calls to a "unzip"-DLL of your choice
    Choose the one that is easier to implement for you
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Native extension to unzip a file crash my air app

    Hello,
    I have a problem with a native extension for android
    I want to unzip a file
    my java code
    File f = new File("my zip file");
    File outputDir = new File ("output folder");
    ZipHelper.unzip(f, outputDir);
    and
    import java.util.zip.*;
    import java.io.*;
    import java.util.Enumeration;
    import org.apache.commons.io.IOUtils;
    import android.util.Log;
    public class ZipHelper
    static public void unzip(File archive, File outputDir)
    try {
    Log.d("control","ZipHelper.unzip() - File: " + archive.getPath());
    ZipFile zipfile = new ZipFile(archive);
    for (Enumeration e = zipfile.entries(); e.hasMoreElements(); ) {
    ZipEntry entry = (ZipEntry) e.nextElement();
    unzipEntry(zipfile, entry, outputDir);
    catch (Exception e) {
    Log.d("control","ZipHelper.unzip() - Error extracting file " + archive+": "+ e);
    static private void unzipEntry(ZipFile zipfile, ZipEntry entry, File outputDir) throws IOException
    if (entry.isDirectory()) {
    createDirectory(new File(outputDir, entry.getName()));
    return;
    File outputFile = new File(outputDir, entry.getName());
    if (!outputFile.getParentFile().exists()){
    createDirectory(outputFile.getParentFile());
    Log.d("control","ZipHelper.unzipEntry() - Extracting: " + entry);
    BufferedInputStream inputStream = new BufferedInputStream(zipfile.getInputStream(entry));
    BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outputFile));
    try {
    IOUtils.copy(inputStream, outputStream);
    catch (Exception e) {
    Log.d("control","ZipHelper.unzipEntry() - Error: " + e);
    finally {
    outputStream.close();
    inputStream.close();
    static private void createDirectory(File dir)
    Log.d("control","ZipHelper.createDir() - Creating directory: "+dir.getName());
    if (!dir.exists()){
    if(!dir.mkdirs()) throw new RuntimeException("Can't create directory "+dir);
    else Log.d("control","ZipHelper.createDir() - Exists directory: "+dir.getName());
    i copy the file commons-io-2.4.jar (I get at http://commons.apache.org/proper/commons-io/download_io.cgi) in the lib folder of eclipse.
    in a native android app, this code work fine
    in a native extension for air, my air app crash
    LogCat in eclipse return
    NoClassDefFoundError: org.apache.comons.io.IOUtils.copy
    IOUtils class is not in commons-io-2.4.jar ???
    thanks

    Hello,
    I have a problem with a native extension for android
    I want to unzip a file
    my java code
    File f = new File("my zip file");
    File outputDir = new File ("output folder");
    ZipHelper.unzip(f, outputDir);
    and
    import java.util.zip.*;
    import java.io.*;
    import java.util.Enumeration;
    import org.apache.commons.io.IOUtils;
    import android.util.Log;
    public class ZipHelper
    static public void unzip(File archive, File outputDir)
    try {
    Log.d("control","ZipHelper.unzip() - File: " + archive.getPath());
    ZipFile zipfile = new ZipFile(archive);
    for (Enumeration e = zipfile.entries(); e.hasMoreElements(); ) {
    ZipEntry entry = (ZipEntry) e.nextElement();
    unzipEntry(zipfile, entry, outputDir);
    catch (Exception e) {
    Log.d("control","ZipHelper.unzip() - Error extracting file " + archive+": "+ e);
    static private void unzipEntry(ZipFile zipfile, ZipEntry entry, File outputDir) throws IOException
    if (entry.isDirectory()) {
    createDirectory(new File(outputDir, entry.getName()));
    return;
    File outputFile = new File(outputDir, entry.getName());
    if (!outputFile.getParentFile().exists()){
    createDirectory(outputFile.getParentFile());
    Log.d("control","ZipHelper.unzipEntry() - Extracting: " + entry);
    BufferedInputStream inputStream = new BufferedInputStream(zipfile.getInputStream(entry));
    BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outputFile));
    try {
    IOUtils.copy(inputStream, outputStream);
    catch (Exception e) {
    Log.d("control","ZipHelper.unzipEntry() - Error: " + e);
    finally {
    outputStream.close();
    inputStream.close();
    static private void createDirectory(File dir)
    Log.d("control","ZipHelper.createDir() - Creating directory: "+dir.getName());
    if (!dir.exists()){
    if(!dir.mkdirs()) throw new RuntimeException("Can't create directory "+dir);
    else Log.d("control","ZipHelper.createDir() - Exists directory: "+dir.getName());
    i copy the file commons-io-2.4.jar (I get at http://commons.apache.org/proper/commons-io/download_io.cgi) in the lib folder of eclipse.
    in a native android app, this code work fine
    in a native extension for air, my air app crash
    LogCat in eclipse return
    NoClassDefFoundError: org.apache.comons.io.IOUtils.copy
    IOUtils class is not in commons-io-2.4.jar ???
    thanks

  • Problen in unzip a file in folder structure

    hi,
    how can i unzip a file and folder with folder structure. when i unzip a file it create problem. please help to solve this problem.
    here is my code
    import java.io.*;
    import java.util.zip.*;
    public class MakeUnzip {
    final static int BUFFER = 2048;
    public static void main (String argv[]) {
    try {
    BufferedOutputStream dest = null;
    FileInputStream fis = new FileInputStream("D:/serverdata/dates.zip");
    // String root = "D:/clientdata/";
    ZipInputStream zis = new
    ZipInputStream(new BufferedInputStream(fis));
    ZipEntry entry;
    ZipFile zipfile = new ZipFile("D:/serverdata/dates.zip");
    while((entry = zis.getNextEntry()) != null) {
    int count;
    byte data[] = new byte[BUFFER];
    if(entry.isDirectory()){
         File dir = new File(entry.getName());
         if(!dir.exists()){          dir.mkdir();                 }      
    FileOutputStream fos =null;
    fos = new FileOutputStream(entry.getName());
    dest = new BufferedOutputStream(fos, BUFFER);
    while ((count = zis.read(data, 0, BUFFER))
    != -1) {
    dest.write(data, 0, count);
    dest.flush();
    dest.close();
    zis.close();
    } catch(Exception e) {
    e.printStackTrace();
    Please give me solution.
    Thanks in advance

    try this one and change it as u like:
    import java.util.zip.ZipFile;
    import java.util.zip.ZipEntry;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.io.File;
    public class UnzipFile {
    private static void doUnzipFiles(String zipFileName) {
    try {
    ZipFile zf = new ZipFile(zipFileName);
    System.out.println("Archive: " + zipFileName);
    // Enumerate each entry
    for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
    // Get the entry and its name
    ZipEntry zipEntry = (ZipEntry)entries.nextElement();
    if (zipEntry.isDirectory())
    boolean success = (new File(zipEntry.getName())).mkdir();
    else
    String zipEntryName = zipEntry.getName();
    System.out.println(" inflating: " + zipEntryName);
    OutputStream out = new FileOutputStream(zipEntryName);
    InputStream in = zf.getInputStream(zipEntry);
    byte[] buf = new byte[1024];
    int len;
    while((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    // Close streams
    out.close();
    in.close();
    } catch (IOException e) {
    e.printStackTrace();
    System.exit(1);
    public static void main(String[] args) {
    if (args.length != 1) {
    System.err.println("Usage: java UnzipFile zipfilename");
    } else {
    doUnzipFiles(args[0]);
    }

  • Decrypt and unzip a File + read a XML file received into the ZIP

    Hello,
    I need your help to develop some a complex Biztalk application.
    Here're my needs :
    Our Busness partner send us a zip file cripted with a standard PGP(Pretty Goof Privacy).
    The zip containts an XML file that i have to deal it, and some attachments file(PDF).
    So i need to know what's the best approach for the developpement of my application.
    I want to decrypt the ZIP and then Unzip the file and them read the XML file received in the zip.
    Knowimg that we already have the pipeline compenent to dectypt the file with the strandar PGP and an other pipeline compenent to unzip the File.
    Thank you

    Hi ,
    Try this code to unzip the file and send the xml message .If u face issue let me know
    namespace BizTalk.Pipeline.Component.DisUnzip
    using System;
    using System.IO;
    using System.Text;
    using System.Drawing;
    using System.Resources;
    using System.Reflection;
    using System.Diagnostics;
    using System.Collections;
    using System.ComponentModel;
    using Microsoft.BizTalk.Message.Interop;
    using Microsoft.BizTalk.Component.Interop;
    using Microsoft.BizTalk.Component;
    using Microsoft.BizTalk.Messaging;
    using Ionic.Zip;
    using System.IO.Compression;
    [ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
    [System.Runtime.InteropServices.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280")]
    [ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]
    public class DisUnzip : Microsoft.BizTalk.Component.Interop.IDisassemblerComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
    private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("BizTalk.Pipeline.Component.DisUnzip.DisUnzip", Assembly.GetExecutingAssembly());
    #region IBaseComponent members
    /// <summary>
    /// Name of the component
    /// </summary>
    [Browsable(false)]
    public string Name
    get
    return resourceManager.GetString("COMPONENTNAME", System.Globalization.CultureInfo.InvariantCulture);
    /// <summary>
    /// Version of the component
    /// </summary>
    [Browsable(false)]
    public string Version
    get
    return resourceManager.GetString("COMPONENTVERSION", System.Globalization.CultureInfo.InvariantCulture);
    /// <summary>
    /// Description of the component
    /// </summary>
    [Browsable(false)]
    public string Description
    get
    return resourceManager.GetString("COMPONENTDESCRIPTION", System.Globalization.CultureInfo.InvariantCulture);
    #endregion
    #region IPersistPropertyBag members
    /// <summary>
    /// Gets class ID of component for usage from unmanaged code.
    /// </summary>
    /// <param name="classid">
    /// Class ID of the component
    /// </param>
    public void GetClassID(out System.Guid classid)
    classid = new System.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280");
    /// <summary>
    /// not implemented
    /// </summary>
    public void InitNew()
    /// <summary>
    /// Loads configuration properties for the component
    /// </summary>
    /// <param name="pb">Configuration property bag</param>
    /// <param name="errlog">Error status</param>
    public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)
    /// <summary>
    /// Saves the current component configuration into the property bag
    /// </summary>
    /// <param name="pb">Configuration property bag</param>
    /// <param name="fClearDirty">not used</param>
    /// <param name="fSaveAllProperties">not used</param>
    public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)
    #region utility functionality
    /// <summary>
    /// Reads property value from property bag
    /// </summary>
    /// <param name="pb">Property bag</param>
    /// <param name="propName">Name of property</param>
    /// <returns>Value of the property</returns>
    private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)
    object val = null;
    try
    pb.Read(propName, out val, 0);
    catch (System.ArgumentException )
    return val;
    catch (System.Exception e)
    throw new System.ApplicationException(e.Message);
    return val;
    /// <summary>
    /// Writes property values into a property bag.
    /// </summary>
    /// <param name="pb">Property bag.</param>
    /// <param name="propName">Name of property.</param>
    /// <param name="val">Value of property.</param>
    private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)
    try
    pb.Write(propName, ref val);
    catch (System.Exception e)
    throw new System.ApplicationException(e.Message);
    #endregion
    #endregion
    #region IComponentUI members
    /// <summary>
    /// Component icon to use in BizTalk Editor
    /// </summary>
    [Browsable(false)]
    public IntPtr Icon
    get
    return ((System.Drawing.Bitmap)(this.resourceManager.GetObject("COMPONENTICON", System.Globalization.CultureInfo.InvariantCulture))).GetHicon();
    /// <summary>
    /// The Validate method is called by the BizTalk Editor during the build
    /// of a BizTalk project.
    /// </summary>
    /// <param name="obj">An Object containing the configuration properties.</param>
    /// <returns>The IEnumerator enables the caller to enumerate through a collection of strings containing error messages. These error messages appear as compiler error messages. To report successful property validation, the method should return an empty enumerator.</returns>
    public System.Collections.IEnumerator Validate(object obj)
    // example implementation:
    // ArrayList errorList = new ArrayList();
    // errorList.Add("This is a compiler error");
    // return errorList.GetEnumerator();
    return null;
    #endregion
    /// <summary>
    /// this variable will contain any message generated by the Disassemble method
    /// </summary>
    private System.Collections.Queue _msgs = new System.Collections.Queue();
    #region IDisassemblerComponent members
    /// <summary>
    /// called by the messaging engine until returned null, after disassemble has been called
    /// </summary>
    /// <param name="pc">the pipeline context</param>
    /// <returns>an IBaseMessage instance representing the message created</returns>
    public Microsoft.BizTalk.Message.Interop.IBaseMessage
    GetNext(Microsoft.BizTalk.Component.Interop.IPipelineContext pc)
    // get the next message from the Queue and return it
    Microsoft.BizTalk.Message.Interop.IBaseMessage msg = null;
    if ((_msgs.Count > 0))
    msg = ((Microsoft.BizTalk.Message.Interop.IBaseMessage)(_msgs.Dequeue()));
    return msg;
    /// <summary>
    /// called by the messaging engine when a new message arrives
    /// </summary>
    /// <param name="pc">the pipeline context</param>
    /// <param name="inmsg">the actual message</param>
    public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
    IBaseMessage Temp = inmsg;
    using (ZipFile zip = ZipFile.Read(inmsg.BodyPart.GetOriginalDataStream()))
    foreach (ZipEntry e in zip)
    var ms = new MemoryStream();
    IBaseMessage outMsg;
    outMsg = pc.GetMessageFactory().CreateMessage();
    outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
    outMsg.Context=inmsg.Context;
    e.Extract(ms);
    string XMLMessage = Encoding.UTF8.GetString(ms.ToArray());
    MemoryStream mstemp = new System.IO.MemoryStream(
    System.Text.Encoding.UTF8.GetBytes(XMLMessage));
    outMsg.GetPart("Body").Data = mstemp;
    _msgs.Enqueue(outMsg);
    #endregion
    Thanks
    Abhishek

  • SSIS Execute Process Task to Unzip Remote Files

    I have created an SSIS Execute Process Task to unzip files on a remote server.
    Executable: \\servername\c$\Program Files (x86)\7-Zip\7z.exe
    Arguments: -o\\servername\d$\DBFiles\ -y x \\servername\d$\DBFiles\somefile.zip
    The zip file size is about 40MB.
    The SSIS task runs very slowly, close to 5 minutes. I know it should not take this long. When I remote logon to the server and run the 7z program to unzip the same file, it unzips in less than 10 seconds.
    It seems that the way it is set up now, it constantly sending instructions back and forth from my PC to the server when I run the SSIS package on my PC.  
    I have 50 files of varying sizes that need to be processed daily. The SSIS unzip task takes 2 hours just to unzip these files.
    How should I set up the SSIS Execute Process Task so that it can unzip files on remote server efficiently?
    Many thanks in advance

    The reason is that the files contain data that need to be loaded to the database. So, the zipped data files are copied to the server where the database lives. The SSIS package unzips the files and loads the database. The SSIS package is stored on the same
    server. The server lives in the remote data centre.
    My team run the SSIS package using Managament Studio running their PCs in the office, which is a different location to the data centre.
    Since the package and files live on the same remote server, I would have thought that that would not be an issue. But the fact that we run the package locally means that the package is executed locally.
    My goal is to put the zipped data files on the server, unzip the files, load data to a database on a remote server. I need to allow my team of 4 to be able to use Management Studio to run the SSIS packages to do the above. Would I be better off Remote
    Desktop connecting to the server and execute the package there?
    I will check out the PowerShell option.

Maybe you are looking for

  • In Pages 5.5.3, How to stop automatic numbering of Lines & Paragraphs?

    How can I stop the A. B. on the extreme left of the page? Anything I try screws up the rest of the formatting. I see nothing in Prefernces to stop this.

  • HT1595 how can i connect using enterprise wireless

    How can I using my dorm wireless internet to connect apple tv?

  • Dimension based on hierarchy variable not showing attributes

    Hi all. I created a BEx query with a hierarchy variable on 0MATERIAL ready for input, so that when I execute the query it prompts me to select one of the hierarchies node. I created a universe on top of this query and the prompt is also present in th

  • Help on comments

    hi all, how to give the comments on columns ? i issued following queries , COMMENT ON COLUMN tbl_import_folio_log.Step_1_Upload_file_sheet IS 'Uploaded File Name Sheet'; COMMENT ON COLUMN tbl_import_folio_log.Step_1_Upload_file_path IS 'Uploaded File

  • About Cluster tables

    Hi SAP gurus, Can I get any documentation regarding how these cluster tables are filled when payroll is executed means how RT WBBP all these will get filled Thanks in advance Regards, Satya