Create checkPath() and convert PUT->dir