Page 1 of 1
syncfile error when using ftp (dev. app by cspro 8.1)
Posted: August 19th, 2026, 1:55 am
by eeng
Dear CsPro team,
I am encountering an issue with the synchronization process using FTP.
When I transfer MP3 audio files via FTP using the `syncfile` function, the process works smoothly if the CAPI application was developed using CSPro 7.7, but a synchronization error occurs if it was developed using CSPro 8.1.
There are no issues when synchronizing data entry files (CSDB).
The CAPI and synchronization processes are running on Android device. I have attached an image of the error message.
Has anyone else experienced this and found a solution?
Thank you.
eeng
Re: syncfile error when using ftp (dev. app by cspro 8.1)
Posted: August 24th, 2026, 8:00 am
by Gregory Martin
Can you share your code or provide more details on the error? Testing FTP synchronization on Android now, I see that there is a difference in the Windows and Android implementations of syncfile(get). On 8.1, this works on Windows:
syncfile(get, "my-file.txt");
But it will not work on Android as you need to specify a path on the server, including directory information. In other words, this will work on both Android and WIndows:
syncfile(get, "/my-file.txt");
Re: syncfile error when using ftp (dev. app by cspro 8.1)
Posted: August 26th, 2026, 10:37 pm
by eeng
Dear Martin,
my code in global function is:
//mp3 files list
function string pickMp3()
list string mp3_files;
dirlist(mp3_files, surveyAudioPath, listing_mp3);
list string filenames;
do numeric i = 1 while i <= mp3_files.length()
filenames.add(path.getfilename(mp3_files(i)));
enddo;
if filenames.length() = 0 then
errmsg("Tidak ada file MP3");
reenter;
endif;
numeric pick = filenames.show();
if pick > 0 then
pickMp3 = mp3_files(pick);
else
pickMp3 = "";
endif;
end;
then here is my code on menu selection:
elseif MENU = 5 then
listing_mp3=maketext("B*TKA*mp3");
string pick = pickMp3();
string pickaudio= pick[28:20];
errmsg( "file audio: %s telah dipilih, ok kirim ke server ", pickaudio);
if pick <> "" then
string ftpServerUrl = "ftp.xxxx";
string ftpUser = "xxxx";
string ftpPass = "xxxx";
// send the latest mp3 files to the FTP server
if syncconnect(FTP,ftpServerUrl,ftpUser,ftpPass) = 1 then
string pickaudio2 = maketext("./Audio/%s*.mp3",pickaudio);
syncfile(PUT,pickaudio2,"/TKA_Audio");
syncdisconnect();
endif;
endif;
reenter;
note: this code work build by cspro 7.7 and android device.
work when sending via csentry dekstop (cspro 8.1) but error in android device
best
-eeng