check file before upload