fix upload encoding bug