The save file dialog can be used to let the user select the location of a file that needs to be stored/saved in the explorer.
uses Vcl.Dialogs.TFileSaveDialog
Activity properties
begin var ReturnList: string; var IsExecuted: Boolean; var FileDialog := TFileSaveDialog.Create(nil); try IsExecuted := FileDialog.Execute; if IsExecuted then ReturnList := FileDialog.FileName; finally FileDialog.Free; end;
end; |
Resulting code
The value of the 'store selected file(s) in' property is dependent on the option 'multiple files'. If 'multiple files' is selected, the property expects a string list to store the selected paths in. Otherwise a string variable is expected to store the selected path in.
If the 'Pick folders' option is selected, only folder can be selected.
The 'File/Path must exist' options are selectable for validation. If the options are not selected, the user is able to type in a file/folder and select it, regardless of it exists.
The 'Default file path' fills the selected file name for the user.