Page 1 of 1

Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Posted: September 2nd, 2024, 5:51 am
by wissem
Hello,

I have a project for scanning documents using CSentry, and I’m facing the following issue:

I don't want to synchronize photos that have already been sent.

I used the following script:

PROC SYNC1

if syncconnect(dropbox) and $="1" then
syncfile(PUT,pathname(csentry)+"/*.jpg","/SCAN CIN");
endif;

Any suggestions or solutions would be greatly appreciated. Thanks in advance!

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Posted: September 3rd, 2024, 10:22 am
by savy
One option is to move the images that have been synced to an archive folder. https://www.csprousers.org/help/CSPro/f ... ction.html
The other option is to use binary dictionary items introduced in CSPro 8.0. When using binary dictionary items, content associated to it are part of the case and are not resynced again if they are not changed.
https://www.csprousers.org/help/CSPro/b ... items.html

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Posted: September 3rd, 2024, 3:20 pm
by Mariovaisman
Hello,
Maybe I am wring, but as I know, if you syncronize to a csweb server, the transmission is smart, if the file you are transiting it was transmitted before and it has no changes from the previous transmission, it is not transmitted again, however the result code is like it was transmitted correctly. It means it transmits only the new files or modified files, then you don't need to have a logic to decide what to transmit and what no.
Thanks
Mario

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Posted: November 24th, 2024, 5:07 pm
by copernix2
Hi you can Try the code below :
if ! syncconnect(csweb, host_file,user, pass_file) then
        
errmsg("Error connection");
        
reenter;
    
endif;
list string files_to_sync;
    
numeric last_sync_time = tonumber(loadsetting("last_sync_time", "0"));
    
dirlist(files_to_sync, PathData+"photos", filter := "*.png", recursive := true);

    
do numeric ctr = 1 while ctr <= files_to_sync.length()
        
if filetime(files_to_sync(ctr)) < last_sync_time then
            
next;
        
endif;
        
if ! syncfile(PUT,files_to_sync(ctr), "/myFolder/") then
            
errmsg("Not send");
            syncdisconnect();
            
reenter;
        
endif;
    
enddo;
syncdisconnect();
errmsg("Success");