08-29-2013 12:29 PM
Hi all,
I'm trying to write a file to a network share using the Unity API. The code works great if the entire path exists. If a portion of it doesn't, I receive the following error:
"Could not find a part of the path"
My goal is to have the file go in to a subfolder on this UNC path which is named after one of the keywords. Is there a way to make Utility.WriteStreamToFile work if one of the subfolders in the path needs dynamically created?
We are running 13.0.0.37.
Thanks,
Nick McElheny
08-29-2013 12:34 PM
Hi Nick,
I would use Directory.Exists() to check your path, then use Directory.CreateDirectory() to create the path if it doesn't exist. CreateDirectory will also create any directories in the path that don't exist yet. Then you can use WriteStreamToFile for that path. [http://msdn.microsoft.com/en-us/library/System.IO.Directory_methods.aspx]
Thanks,
08-29-2013 12:45 PM
Justin,
That did just the trick. Thanks!!
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.