My advice is to create your FTP directory from within a BO message
handler using the ..Adapter.FTP property that is already available there.
If you need to use FTP features outside of a BO, you should just use
class %Net.FTPSession without involving an adapter at all.
Ted
On 2/1/2012 10:30 AM, Vishal Bhavsar wrote:
> Hi Akash,
> Thanks for your reply.
>
> I tried below code to make dynamic folders and to put the file on the
> ftp location.
>
> Class Utility.Util Extends Ens.Rule.FunctionSet [ Abstract ]
> {
>
> Method DynamicFolder(pRequest As EnsLib.HL7.Message) As %Status
> { s Adapter = ##class(EnsLib.FTP.OutboundAdapter).%New()
> s Adapter.SSLConfig ="FTPSSSL"
> s Adapter.FTPServer = "IPAddress"
> s Adapter.FTPPort = "21"
> s Adapter.Credentials="credential"
> s Adapter.FilePath = "/"
>
> s filePath = "test/testfolder/testfolder2"
>
> s session = ##class(%Net.FtpSession).%New()
> d session.Connect("IPAddress
> ","username","password","21")
> s session.SSLConfiguration = "FTPSSSL"
> s tSC = Adapter.Connect(30,0)
> set filePathArr = $LFS(filePath,"/")
> s path=""
> try
> {
> For i=2:1:$LL(filePathArr)
> {
> s path= path_
> $LIST(filePathArr,i)
However (not knowing the details of your specific situation) I still
think you should do all this in a BusinessOperation. Use
..Adapter.FTP.MakeDirectory() to make the directory, Set
..Adapter.FilePath to change to the directory and call
..Adapter.PutStream() to populate the file.
Ted