How to validate files uploaded by user effectively?

This for sure will not work… How do You append the file and path?