You can check for network connectivity.
If network is off, store date on the hard drive of the user.
Once the network comes on, send this data to the online server.
HTML5 has an offline storage capability -
http://www.codemag.com/Article/1112051[
^].
Of course, for large data, this may not be the most optimal solution.
Other approaches will need to be considered.