PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → ftpget proper syntax?
ftpget proper syntax?
Débuté par christophe, 19 fév. 2016 23:21 - 1 réponse
Posté le 19 février 2016 - 23:21
Hi

Why is this working:
IF FTPGet(GlobalProcedures.ftpconnectionid, GlobalProcedures.cs_targetupdate_ + "exe/scanner.exe", "somelocallocation") = True THEN
//open(EXPRESS_WIN_message,"Download Completed.",1,0)
ELSE
Open(EXPRESS_WIN_error,lafile,ErrorInfo())
END


And this not?
[code:wl]
filearray is array of string
Add(filearray,"scanner.exe")
[ FOR EACH lafile OF filearray
IF FTPGet(GlobalProcedures.ftpconnectionid, GlobalProcedures.cs_targetupdate_ +"exe/" + lafile, "somelocallocation") = True THEN
//open(EXPRESS_WIN_message,"Download Completed.",1,0)
ELSE
Open(EXPRESS_WIN_error,lafile,ErrorInfo())
END
END
/code]

(only usefull code mentioned)
The 'not working code' is just an array with some files to download but it doesn't seem to work. When I type the full name then it is downloading...? Is their something wrong with the syntax of: GlobalProcedures.cs_targetupdate_ + "exe/" + lafile
Posté le 20 février 2016 - 13:43
Hi Christophe,

it -MAY- be that your configuration setting is in unicode. In that case,
filearray is array of string really means filearray is array of UNICODE
string

and then, in the ftpget, there is an automatic
concatenation/transformation -OR NOT- and the string sent is not what
you think

I find it better to ALWAYS declare UNICODE string or ANSI string, so
that I know for sure what I'm dealing with.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


On 2/19/2016 5:21 PM, christophe wrote:
Hi

Why is this working:
IF FTPGet(GlobalProcedures.ftpconnectionid,
GlobalProcedures.cs_targetupdate_ + "exe/scanner.exe",
"somelocallocation") = True THEN
//open(EXPRESS_WIN_message,"Download Completed.",1,0)
ELSE
Open(EXPRESS_WIN_error,lafile,ErrorInfo())
END


And this not?
[code:wl]
filearray is array of string
Add(filearray,"scanner.exe")
[ FOR EACH lafile OF filearray
IF FTPGet(GlobalProcedures.ftpconnectionid,
GlobalProcedures.cs_targetupdate_ +"exe/" + lafile,
"somelocallocation") = True THEN
//open(EXPRESS_WIN_message,"Download Completed.",1,0)
ELSE
Open(EXPRESS_WIN_error,lafile,ErrorInfo())
END
END
/code]

(only usefull code mentioned) The 'not working code' is just an array
with some files to download but it doesn't seem to work. When I type
the full name then it is downloading...? Is their something wrong with
the syntax of: GlobalProcedures.cs_targetupdate_ + "exe/" + lafile