modified upload handler for fixing encoding problem