magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 02 > Programming with Perl  

Uploading Files and Sending MIME Mail

Most of us have a junk drawer in our house. You know, the one with the random bits of discarded stuff we hope will come in handy in the future, like the last part of a roll of duct tape, a couple of nuts and washers that for some reason weren't needed when we reassembled the shelves this time, and so on. When something needs to get done, we rummage through the drawer looking for the right part or widget, only to pass the same useless items time after time. But every once in a while we find something that's actually useful and we think, "Yeah, I'm so glad I saved that!"

Well, as a software toolsmith, I have a virtual junk drawer as well. I collect little snippets of code that I see float by, in hopes of reassembling them into some useful tool someday. Recently, I needed to do some file uploads as well as learn how to send MIME mail; three snippets I'd happened to save came together in such a nice way that I thought I'd share the program with you. Of course, you can take the program as is, but I hope you instead throw this program into your virtual junk drawer so that if anyone asks you to upload a file, send a MIME attachment, or strip a MacBinary resource fork, you'll find these gems in your drawer.

So, this month we'll do some simple tasks in a nice way. Upload a file, send it as email somewhere. And if the file happens to be uploaded as a MacBinary encapsulated file, we'll even extract the data fork, if requested. And that brings us to the program in



  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2