Sorry, Chris! I should have been more precise. No custom control needed, just add the normal InfoPath file attachment control. After you read the contents off, decode into a new file and save someplace, you can set the text value back to blank so that you aren't storing that bulky file. You could even use some conditional formatting to decide when to show/hide the file control, and add another field (again, see my earlier link for the conversation on linking to a file in InfoPath, you may have to manipulate things a bit) that you will use to store the link to the file.
That way, the user adds the file using the normal IP experience, and, like magic, the file gets stored off someplace else and they are left with a link.
Oh, and in your onAfterChange, for you decode stuff, do it in an if statement that checks to make sure the event is an 'Insert' event, like this:
if ( !e.Operation.Equals("Insert"))
That way your event won't run twice... although, you'll probably want to do something on Delete, too, so that if your user choses to get rid of the file they selected, it isn't hanging out where you wrote it off to, cluttering up the place....