Cache Object Script How to MakeDirectory FTP Class

108 views Asked by At

In Cache Object Script how can I make a remote directory on an FTP Server. I do see the class MakeDirectory but that is returning 0 when I call it?

set ftp=##class(%Net.FtpSession).%New()
d ftp.Connect(COMServer,c.Username,c.Password)
d ftp.SetDirectory("/Test")
w ftp.MakeDirectory("6666")
0
1

There are 1 answers

1
SSH On BEST ANSWER

This should create directory 6666 under /Test, are you sure /Test exists and you have enough privileges to create directory there?

You can check ftp.ReturnCode and ftp.ReturnMessage to check for server response.