I have been making some experiments with FTP and BASIC macros. So far I have confirmed, that uploading and downloading files with simple file access is possible, but folder creation fails (the user account can use other clients to crate folders on ftp server).
So I have tried to make use of FTPContentProvider. But I can't figure out how to use it.
So far I have managed to get to:
Code: Select all
dim ftpContPro, ftpCont, ucb, ftpContId, newCont, test
Dim oContInfo As New com.sun.star.ucb.ContentInfo
Dim command As New com.sun.star.ucb.Command
Dim openCom As New com.sun.star.ucb.OpenCommandArgument2
ftpContPro = CreateUnoService("com.sun.star.ucb.FTPContentProvider")
ucb = CreateUnoService("com.sun.star.ucb.UniversalContentBroker")
ftpContId = ucb.createContentIdentifier("ftp://ftptest:test@127.0.0.1")
ftpCont = ftpContPro.queryContent(ftpContId)
command.Handle = -1
command.Name = "getCommandInfo"
test = ftpCont.execute(command, ftpCont.createCommandIdentifier(), null)
Code: Select all
oContInfo.Type = "application/vnd.sun.staroffice.ftp-box"
newCont = ftpCont.createNewContent(oContInfo)
Can anyone help with this?