PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → ftpget proper syntax?
ftpget proper syntax?
Started by christophe, Feb., 19 2016 11:21 PM - 1 reply
Posted on February, 19 2016 - 11:21 PM
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
Posted on February, 20 2016 - 1:43 PM
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