Web Connection
long file name issue with wwSFTP
Rick,
Just implemented your wwSFTP class and all is fine when connecting, showing files, uploading files, and downloading files WITHOUT spaces in the file name.
When trying to download a file with a space in the file name, the destination file is 0 bytes and there are no errors.
lnResult = loFtp.FtpGetFile(lcHost, lcFileName, lcDestination , lnBinary, lcUsername,lcPassword)
A bug perhaps?
Just tried that here with my local test server, and it seems to be working for me. It's possible your server doesn't support the files with spaces.
I'm using the Rebex Test Server and maybe you can try your file scenario with that.
Here's the FoxUnit test case:
FUNCTION DownloadFileWithSpacesSimple()
loFtp = CREATEOBJECT("wwSftp")
lcHost = "127.0.0.1"
lnPort = 23
lcUsername = "tester"
lcPassword = "password"
loFtp.nFtpPort = lnPort
lcOutputFile = ".\tests\sailbig.jpg"
DELETE FILE lcOutputFile
lnResult = loFtp.FtpGetFile(lcHost,"Sail Big.jpg",lcOutputFile,1,lcUsername,lcPassword)
this.AssertTrue(lnResult == 0,loFtp.cErrorMsg)
this.AssertTrue(FILE(lcOutputFile),"Failed: File wasn't created")
this.AssertTrue(FileSIZE(lcOutputFile) > 0,"Failed: File Size is " + TRANSFORM(FSIZE(lcOutputFile)))
ENDFUNC
* DownloadFileWithSpacesSimple