Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Post Reply
wissem
Posts: 4
Joined: September 29th, 2018, 8:00 am

Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Post 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!
savy
Posts: 177
Joined: December 27th, 2012, 1:36 pm

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Post 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
Mariovaisman
Posts: 143
Joined: February 11th, 2013, 8:26 am

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Post 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
copernix2
Posts: 19
Joined: November 23rd, 2014, 7:46 am

Re: Preventing Duplicate Photo Synchronization in CSentry Document Scanning Project

Post 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");
Oumar DIOP from Sénégal.
Post Reply