Sample code for 30+ languages & platforms
Java

Decode Base64 to Zip File

See more Base64 Examples

Shows how to decode a baes64 string that is the encoded representation of the bytes that make up a .zip archive. Decodes the base64 and writes the .zip file.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    boolean success = false;

    String b64 = "UEsDBBQA ... AAALgQAAAAA";

    CkBinData zipData = new CkBinData();
    success = zipData.AppendEncoded(b64,"base64");
    success = zipData.WriteFile("qa_output/out.zip");
    if (success != true) {
        System.out.println("failed to write Zip file.");
        return;
        }
  }
}