Web Connection
long file name issue with wwSFTP
Gravatar is a globally recognized avatar based on your email address. long file name issue with wwSFTP
  Michael B
  All
  Aug 25, 2019 @ 04:13pm

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?

Gravatar is a globally recognized avatar based on your email address. re: long file name issue with wwSFTP
  Rick Strahl
  Michael B
  Aug 26, 2019 @ 08:52am

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
Gravatar is a globally recognized avatar based on your email address. re: long file name issue with wwSFTP
  Michael B
  Michael B
  Aug 26, 2019 @ 02:04pm

Thanks Rick - I had a bug in my syntax it seems so false alarm. Sorry to bug ya. I do have another question though but I will create a new thread just in case.

© 1996-2024