Page 1 of 1

Dropbox synchronization folder name

Posted: July 28th, 2019, 2:38 pm
by axel
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?

Re: Dropbox synchronization folder name

Posted: July 28th, 2019, 7:17 pm
by josh
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...

Re: Dropbox synchronization folder name

Posted: July 29th, 2019, 6:20 am
by axel
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.

Re: Dropbox synchronization folder name

Posted: July 29th, 2019, 2:12 pm
by josh
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().