This question has been somewhat answered before, though vaguely, so I'm giving it a try.
Basically, I have the attached code in a CGI uploading script. It uses this bit of code to POST the infor...
http://www.experts-exchange.com/Programming/Languages/Scripting/CGI/Q_23273105.html