Dropbox synchronization folder name

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
axel
Posts: 5
Joined: June 16th, 2019, 7:07 pm

Dropbox synchronization folder name

Postby axel » July 28th, 2019, 2:38 pm

Hi
I have an issue with dropbox synchronization
I name my folder with interviewer name and sysdate and systime

but when receiving data some folder are named as interviewer name (NOM_AGENT_SAISIE) + sysdate + systime
like (axel 07282019230)
but other folders are just named with sysdate+ systime like (07282019230) instead of (axel 07282019230)

below my logic

Code: Select all

 function synchro()
if syncconnect(Dropbox)=1 then
 syncfile(PUT,pathname(InputFile)+"pisteur.csdb", "CCA/PISTEURS/" + NOM_AGENT_SAISIE + edit("99999999", sysdate("DDMMYYYY"))+edit("9999", systime("HHMM"))+"/");
 
 syncdisconnect();
endif;
end 


can someone explain to me why I get two different names with the same logic?

josh
Posts: 1904
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dropbox synchronization folder name

Postby josh » July 28th, 2019, 7:17 pm

First off you really shouldn't be using syncfile() with csdb files. You should use syncdata() instead. Then you won't have to worry about naming folders in the Dropbox at all.

Looking at your code I would guess that NOM_AGENT_SAISIE is empty in some cases causing your path to be incorrect. Another possibility is that NOM_AGENT_SAISIE contains some characters that are not allowed in a filename like / * : < > | etc...

axel
Posts: 5
Joined: June 16th, 2019, 7:07 pm

Re: Dropbox synchronization folder name

Postby axel » July 29th, 2019, 6:20 am

Hi Josh,

I will try with syncdata function for synchronization.
I tried myself with my name but cannot get the folder name as I want like in the example (axel 07282019230)
there are no special characters but cannot get the result.

josh
Posts: 1904
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dropbox synchronization folder name

Postby josh » July 29th, 2019, 2:12 pm

I would use errmsg() or trace() to print out the value of NOM_AGENT_SAISIE to see if it is correct. Also if NOM_AGENT_SAISIE is a variable from the dictionary you may want to remove trailing blanks by using strip().


Return to “Synchronization”