Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1123
5.0.19 and later
How to control the creation of new folders when saving to disk.

In versions 5.0.19 and later, attempting to save a file to a non-existent directory will fail by default. In versions prior to 5.0.19, attempting to save to a non-existent directory would always result in the directory being created with no warning or prompt. Now the file will not be saved unless the new CreateDirectoryPath property is set to True.


When uploading a file you can set a property that will create a new directory if the destination directory does not exist. To force the creation of the new directory, set FileUpEe's new CreateDirectoryPath property to True. This can be set for all files in the upload, or as a property on each individual file. The property should be set before any calls are made to Save or SaveAs (or before calling SendRequest in an autoprocessed 3-tier upload).

Set for all files in an upload:

FileUpEe.CreateDirectoryPath = [Boolean]

Or set for each file in the upload:

FileEe.CreateDirectoryPath = [Boolean]

No exception will be thrown if an attempt is made to save a file to a non-existent directory without enabling CreateDirectoryPath, so it is necessary to examine Processed property of the FileEe object to determine the success or failure of the save attempt. A value of 0 or saSaved indicates success, and a value of 5 or saNoAction indicates that the path could not be created and the file was not saved.

Created : 9/7/2005 12:26:39 PM (last modified : 9/7/2005 12:26:39 PM)
Rate this article!