l=int(self.headers['content-length'])
ct=self.headers['content-type']
mfdb='multipart/form-data; boundary='
if ct and mfdb in ct:
ctl=len(ct)-len(mfdb)
l=l-(((ctl+2)*2)+2) # top border (plus \r\n), bottom border (plus\r\n),$
for fpheader in fp.headers:
l=l-len(fpheader)
l=l-len(fp.headers[fpheader])
l=l-4 # ": " and "\r\n"
l=l-8 # I don't know, but the numbers always seem to be off by 8