Avoid invalid string on file upload