Code ported from bash script to PHP to facilitate painless upload to Yousendit public dropboxes.