Fixed uploads being broken by changing readlines() to read().