fix some Redirect file size always zero
merge write file bug fix