Try this instead: You check the name of the input in the form, and you check if the 'datasheet' directory exists.