iosimagebackupphotosalassetlibrary

How to get all photos(>200) from device and send to server for Backup


I need some help to get all photos from local storage and send those to server for Backup purpose. I am able to get those by using AssetsLibrary framework, but app got crash due to RAM memory usage. Is there any way to upload all my images to server and later based on time(Daily backup) I need to send only which are not uploaded earlier.


Solution

  • This require a well designing of 3 tier architecture of your app. Will give you a short info on how you can achieve it, But it requires an R&D and effort if you are working alone.

    Step 1. Create a column in your local storage (sqlite or coreData) which will represent timeStamp.

    Step 2. Create Helper class in order to do fetching and updating functionality. (using delegates or callbacks) something like

    -(void)sendAllImagesToServer:(NSString*)aBaseURL imageData:(NSData*)aData completionBlock:(void(^)(BOOL isSuccess))aSuccessCallback {
    
    }
    

    Step 3. If this is 2 way communication like, If server updates and you need to get updated image then write a method to do that too.

    In order to get understanding of 3 tier architechture and Uploading multiple images and something about sync functionality