Mercurial > hg > webaudioevaluationtool
changeset 123:4e1217433289
Session save to server falback to browser download if the server didn't save the file.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Wed, 27 May 2015 09:10:20 +0100 |
parents | 0c66c0bf2f69 |
children | 1ea9a9eeeae5 |
files | core.js |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/core.js Tue May 26 18:47:59 2015 +0100 +++ b/core.js Wed May 27 09:10:20 2015 +0100 @@ -291,6 +291,10 @@ var xmlhttp = new XMLHttpRequest; xmlhttp.open("POST",destURL,true); xmlhttp.setRequestHeader('Content-Type', 'text/xml'); + xmlhttp.onerror = function(){ + console.log('Error saving file to server! Presenting download locally'); + createProjectSave(null); + }; xmlhttp.send(file); } return submitDiv;