fix file upload (using text mode ) bug