Thank you @Cristiano Silva !

I had tried LinkToFile earlier but was getting an invalid error for some reason. From reading your solution, I realized that the folder needs to be created beforehand and then it can create a file inside it. If the folder doesn't exist (I was trying to create a file along with the folder using the LinkToFile method), the method fails.