Sample code for 30+ languages & platforms
PureBasic

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 PureBasic Downloads

PureBasic
IncludeFile "CkBinData.pb"

Procedure ChilkatExample()

    success.i = 0

    b64.s = "UEsDBBQA ... AAALgQAAAAA"

    zipData.i = CkBinData::ckCreate()
    If zipData.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkBinData::ckAppendEncoded(zipData,b64,"base64")
    success = CkBinData::ckWriteFile(zipData,"qa_output/out.zip")
    If success <> 1
        Debug "failed to write Zip file."
        CkBinData::ckDispose(zipData)
        ProcedureReturn
    EndIf



    CkBinData::ckDispose(zipData)


    ProcedureReturn
EndProcedure