Saving into Subfolder

Ok, I have got some basic functions down where I am able to save into the fileReference, but I would like for this to be a cleaner workflow. The fileReference basically reads the entire path plus file name. Is there anyway to just read the folders, and if possible AND to it so that it created a subfolder?

I’m not sure I follow you, do you mean that you’re being returned a full path and you just would like a string of the path minus the filename? Then when you have said edited path, create a subfolder in the path endpoint?