Fixed upload code. Response now written upon callback from form parsing.