multipart decoding on javascript client, nearly finished