I did not see the answer to your question anywhere above, so I will attempt to provide a little more information that might help.
I had the same exact problem just today. I built a series of PDF files, which then were converted to a single tar.gz file and this file bundle I wanted to email to a human processing agent who would respond to these documents in kind. However, when I used the various scripts to generate the correct MIME message format, I ended up sending an attachment that was 0 kB in total size with the name "noname".
With so many people all providing the same answer, I thought to myself that there answers must be correct and that the problem must be somewhere else. The answer to the problem is not the formatting of the message content, nor is it in your headers. Everything there is correct. The problem lies in the mail applications that exist between your application and the recipient e-mail address.
I moved my code to a production server and the message sent without any problems, and the same file that previously sent as "noname 0kb" now was sent as "MikeyPoochigian_2013_05_10__16_28_27.tar.gz 241kb".
I don't know yet what causes this particular failure, but I imagine it is a similar answer to one that I learned earlier this year when my mail application was sending to gmail but not sending to other mail servers. In that particular case, the mail applications were filtering content for SPAM between my development laptop (which had the internal domain of DevelopmentLaptop.local) and the final e-mail address. Because my originating server sent from the domain "DovelopmentLaptop.local", and because this domain was not registered with any DNS as a known address, those mail servers interpreted my test messages as spam. I suspect the same problem is interfering now with the messages that are being sent.
Long answer now short (if that is possible), try porting your code to a production server with a registered public domain and see if it works. If it does, then it is not your code that needs to be fixed. Your code is likely to be fine.