Skip to content

Instantly share code, notes, and snippets.

@hc2p
Created February 22, 2013 16:01
Show Gist options
  • Save hc2p/5014441 to your computer and use it in GitHub Desktop.
Save hc2p/5014441 to your computer and use it in GitHub Desktop.
handleFile: function(file) {
if (file.size / 1000000 > 150) {
var err = "We only support files up to 150 MB";
alert(err);
...
}
var that = this;
$.when(this.upload(file)).pipe(this.getSharedUrl).
done(function(response) {
that.renderResponse(response);
that.postResponse && that.postResponse(response);
that.toggleLoadingIcon();
}).
fail(function(xhr) {
var err;
if (xhr.status == 403) {
err = 'Your Dropbox account seems to be not connected. Please connect it!';
}
else {
err = 'Transfer to server not successful. Please check your internet connection or contact our support team.';
}
alert(err);
...
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment