Skip to content

Instantly share code, notes, and snippets.

@developerfromjokela
Created May 11, 2020 20:02
Show Gist options
  • Save developerfromjokela/4e826fd8e8621bec4cf17f93c2e3a376 to your computer and use it in GitHub Desktop.
Save developerfromjokela/4e826fd8e8621bec4cf17f93c2e3a376 to your computer and use it in GitHub Desktop.
This PHP Script will decode a base64-encoded file to a separate file, command: php b64_decoder.php filename
<?php
$targetPath=__DIR__."/".$argv[1];
echo $targetPath;
$data = file_get_contents($targetPath);
$content= base64_decode($data);
$file = fopen($targetPath.".decoded", 'w');
fwrite($file, $content);
fclose($file);
echo "done";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment