set conditional for directory creation in checkupload function