Takes two parameters, FileName, FileData
Description:
Given a local file name path, the TopQuery expression placed into FileData is saved to disk. This allows any file type to be created in memory and then saved as is to disk. The opposite of this command is the Top Query function of LoadFile$.
If the Top Query field Error does not already exist when this command is run, it will be created. If it does exist, it will be cleared before the specified Action is run. If an error occurs, a runtime error will be thrown, which may be caught with a Try/Catch block and the error string can be inspected or reported using the Top Query Error field.
Examples:
[New] MyFile
MyFile = LoadFile$ "Work\Input.txt"
MyFile = MCase$ MyFile
SaveFile "Work\Output.txt", MyFile
[Pull] Req.HasFile Req.FileName UploadFile
Try
If Req.HasFile
File ("Public/Docs/" & UploadFile), "Copy", Req.FileName
Else
SaveFile ("Public/Docs/" & UploadFile), UploadFile
End If
Catch
HtmlErr ("Sorry, the following error occured: " & Error) 'Example only. System level error details should not be displayed to users
End Try