Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Photo and file offline sync #898

Closed Answered by adrianhall
KieranFleckney asked this question in Q&A
Discussion options

You must be logged in to vote

It's a simple queue mechanism - create a queue on device. When you add a file to the offline area, also add an entry in the queue. When you are synchronizing data, you upload the file and update the queue to indicate it has been uploaded.

Generally, I have a table that has the files in it. Each file has a filename, a state { Local, Error, Uploaded } and an error message in case it was Error. When I go to synchronize, I look for all "Local" files, then upload each one in turn. If the upload is successful, I change the state to Uploaded; if the upload was not successful, I change the state to Error and specify the error.

Once that is complete, I push changes in the table to the remote serve…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by KieranFleckney
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants