I am using a CurlSMBS class for uploading a database to an FTP server.
Works perfectly on macOS, but on Windows I get a last error code of -1 which would indicate that some CURL component could be missing.
Any hints warmly appreciated!
SplashWindow.CURLPort1.OptionUsername = app.fPUN
dim f as new folderitem(app.dbFileName)
SplashWindow.CURLPort1.OptionVerbose = true // generate messages
SplashWindow.CURLPort1.CollectDebugData = True // collect them
SplashWindow.CURLPort1.OptionInFileSize = f.Length
dim result as boolean = SplashWindow.CURLPort1.openMTInputFile (f)
If Not result Then
Dim error As Integer = SplashWindow.CURLPort1.Lasterror
Dim msg As String = SplashWindow.CURLPort1.LasterrorMessage
MsgBox"Error "+error.totext+" creating the database file on the FTP-Server"+eol+eol+msg
dim e as integer = SplashWindow.CURLPort1.Performmt
Why do you check last error there after opening file?
This function doesn’t set last error.
The perform will set it.
And you should check DebugData for the log messages as in examples.
I had the check in there because it worked on macOS or seemed to at least
Sadly, still no success. The port connects and in the end I receive an error 18 file partially sent (meaning 0 bytes)
Do I have to set an option because I want to override an existing file?
Tried with both CURLSMBS and CURLNMBS.
The log, in case it helps:
200 Type set to I
150 Opening BINARY mode data connection for xxxxxDB.SQlite
Remembering we are in dir “”
226 Transfer complete
Uploaded unaligned file size (0 out of 3862528 bytes)
Connection #0 to host xxxxx.net left intact[/quote]
EDIT: maybe I should note that openMTInputFile returns false on Windows. f exists, is readable and has a file length > 0.
Firewall blocks FTP connection maybe?
You can email me whole log and maybe test project with credentials to try here and maybe fix.
I think I got it handled now. Instead of openMTInputFile, I create a memory block from the folderItem and feed it to CURLPort.SetInputData. That works now.
Thanks a lot! (Although I still wonder why on macOS it worked with the former command.)