generate directory out of upload path