Hi guys.

Here is a script that I use to decode a base64 file the zip files are always corrupted after I download em.

Anyone knows whats going on here?

<?
$attch = 'UEsDBAoAAAAAAKscPzIAAAAAAAAAAAAAAAAVAAAATmV3IFRleHQgRG9jdW1lbnQudHh0UEsBAhQACgAAAAAAqxw/MgAAAAAAAAAAAAAAABUAAAAAAAAAAAAgAAAAAAAAAE5ldyBUZXh0IERvY3VtZW50LnR4dFBLBQYAAAAAAQABAEMAAAAzAAAAAAA=';
   header("Cache-control: private");
   header("Content-Type: application/x-zip-compressed");
   header("Content-Disposition: filename=WHATYOUWANTTOCALLTHEFILE.zip");
   echo base64_decode('$attch');
?>

    Hi Roy

    According to the manual, your attachment header isn't quite correct. It should be:

    header('Content-Disposition: attachment; filename="myfile.zip"');

    I hope this makes a difference. I can't test it here.

    HTH

    Norm

      It might also be related to the fact that

      base64_decode($attach);

      has been written as

      base64_decode('$attach');

        A slap on my face for me and
        A jug of beer for you.

        Can't believe my carelessness. 😃

        Originally posted by Weedpacket
        It might also be related to the fact that

        base64_decode($attach);

        has been written as

        base64_decode('$attach');

        [/B]

          Write a Reply...