1

I'm working on a program that allows the user to take GPS tagged images and put them into a que system to be uploaded the moment internet is available.

I could have the page constantly be sending ajax queries via javascript to submit the form with the pictures and text information they took note of, but what if the user never gets the connection and the device decides to restart it's self? (or runs out of batteries), which can and will happen in my particular scenario. In this scenario all the work the user did collecting images and taking notes while the internet was down would go to waste. Is there no way way to save this data every 5 seconds to cookies with javascript or anything?

Is there some way to save some of the data collected (if not the pictures) at least maybe some text that was sent with it by having the ajax perhaps point to a cached version of a page that will set a cookie to remember the information?

Also this is happening on a mobile tablet samsung galaxy tab 3. So I would be limited to the functionality of whatever the default browser is or google chrome.

I have no idea if this is even possible or the best solution to this. Any ideas are appreciated?

Joseph Astrahan
  • 8,659
  • 12
  • 83
  • 154
  • 1
    Could you use the [HTML5 Application Cache](https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache)? – Steven V Nov 22 '13 at 15:00
  • Wow that might just be what I'm looking for possibly :), you are amazing sir. I will have to read through this. I wonder if I can cache pictures the user took? Hopefully this works on the mobile browsers. – Joseph Astrahan Nov 22 '13 at 15:02
  • I think this only cache's server data like images, not the users input unfortunately, unless I'm mistaken? – Joseph Astrahan Nov 22 '13 at 15:06
  • If you combined the usage of application storage and local storage, I think you could get the user input cached/stored. – Steven V Nov 22 '13 at 15:11
  • I found this which is interesting (https://www.ibm.com/developerworks/mydeveloperworks/blogs/bobleah/entry/html5_code_example_store_images_using_localstorage57?lang=en), it talks about a technique to store images using the local storage you were talking about. – Joseph Astrahan Nov 22 '13 at 15:14
  • Do you know anywhere that might have an example of how to do this? That is taking a user input and saving it to storage to be recalled later for upload purposes? – Joseph Astrahan Nov 22 '13 at 15:15
  • Sadly I don't have any examples of this. I would imagine Google could point you in the right direction though! – Steven V Nov 23 '13 at 15:42
  • Thanks for the help so far, once I get the answer I plan to post it here to share with others. I'm working on the application right now using the resources I've found. – Joseph Astrahan Nov 24 '13 at 02:59
  • This might have the answer also, I'm checking it out. http://stackoverflow.com/questions/10333230/save-input-data-to-localstorage-on-button-click – Joseph Astrahan Nov 25 '13 at 17:03

0 Answers0