MIME debugging

Recently for work, I had to deal with converting PDF’s into MIME Base64 encoding to transmit them to a partner vendor.  I had already done 2 successful implementations but the third was proving more challenging than the others.  Our utility built off of library functions did the necessary encoding, but it returned lines of uneven length whereas the vendor we were interfacing with required lines of fixed length.  Normally, this would be a straight forward operation, but what made it difficult was not being able to tell if the output I was generating was correct or not.  Would you know at a glance if you had off-by-one indexing errors just by looking at this:

jO2Kyxjbgr0AkqREL92HWlNwKjyp0UpKgI
jaVOIV0Jw4hyba5CgYHGHFrWsSqwgIl02J
LA2SBFIMSjKegY+R576hCk1acwTEFLNsc2
pmkhAsY32wa73Bc0CVTNfgu3kTZa19s0j7

What really helped is when someone pointed me to this online tool that generates Base64 encoding into lines of specified lengths.   Now, I had a target I could compare my intermediate (reformatted) output against, and then make my way to the final embedded content.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s