Jump to content

Recommended Posts

Posted

I am trying to extract an attachment from an eml file. I have got the attachment body from the txt file, but when I try to decode it with any of the Base64 decoders in the forums, it appears that only half of the file is there. I have tried pasting the input into a commercial converter and it decodes perfectly. What am I missing here? Here is what I have: for testing purposes I have created a file called attach.txt and copied the attachment coding into it.

$file = FileOpen("attach.txt", 0)

$line = BinaryToString(FileRead($file))

$line = Base64Decode($line)

filewrite("output.pdf",$line)

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...