Welcome! Log In Create A New Profile

Advanced

[WM22] Problem with FTPSend on Android

Posted by Erik Schwarz 
Erik Schwarz
[WM22] Problem with FTPSend on Android
June 13, 2019 08:06PM
Hi,

I'm trying to send a file with FTPSend. I'm Connected to the server via sftp. The Connection works, other functions like FTPGet are working too. It seems when I'm connected with sftp the Routine FTPSend cannot find or access the file.
The ErrorInfo Message says: "File or dorectory (!s!) not found or not accessible"

My Code:

nConNumber is int
nConNumber = FTPConnect(“s[example.org]”, “user”, “password”, 22)
fCreate(“helloworld.txt”)
nRes is boolean
bRes = FTPSend(nConNumber, “helloworld.txt”, “/”)
IF bRes = False THEN
Info(ErrorInfo())
END


When I connect with normal ftp it works fine, also in the android Emulator on the PC.
I tested it on a Device running Android 7, and another one running Android 8.

Best regards,
Patrick
Re: [WM22] Problem with FTPSend on Android
June 14, 2019 10:24AM
Hi Patrick,
i use FTPSend on Android device....

Try to change FTPSend(nConNumber, “helloworld.txt”, “/”) to

FTPSend(nConNumber, “helloworld.txt”, “s[example.org]/”)

In my case work perfectly
Patrick Schwarz
Re: [WM22] Problem with FTPSend on Android
June 23, 2019 02:05PM
Hi,

when i type in for <Destinationfile/directory> "servername/" it creates a file with "servername". So it does not except "servername" as the server but sees it as a file or a directory on the server. So I'm wondering how this can work?
Because the servername isn't a part of the full or relative path the function demands here.

Regards
Patrick
Re: [WM22] Problem with FTPSend on Android
June 25, 2019 03:28PM
This code works without any problems

PROCEDURE FTP_Send_na_fiskalni()

nKonekcijaID is int
HourGlass(False)
nKonekcijaID = FTPConnect(gsFTPServer,gsFTPUser,gsFTPLozinka,21)
IF nKonekcijaID <> -1 THEN
HourGlass(True)
IF gsFiskalni_printer = "TRE" THEN
Tremol() //obrada TremolFP
END
IF FTPSend(nKonekcijaID,fCurrentDir()+gsLokal_fajl,"/"+gsServer_fajl,"Transfer_Progress") THEN
ToastDisplay("Poslano na fiskalni printer")
ELSE
ToastDisplay("Nije poslano na fiskalni printer")
END
FTPDisconnect(nKonekcijaID)
HourGlass(False)
ELSE
Error()
END

[infosonline.net]



Edited 3 time(s). Last edit at 06/25/2019 03:32PM by infos.
Attachments:
open | download - kod.jpg (48.2 KB)
Erik Schwarz
Re: [WM22] Problem with FTPSend on Android
July 11, 2019 10:53AM
Hi,

thanks for the info, but your are using a 'ftp' Connection, which works with us, too.
The Problem occurs when trying to use a 'sftp' Connection (secure file Transfer protocol).

g

Erik
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: