Skip to content

Instantly share code, notes, and snippets.

@kyleondata
Created July 10, 2012 14:50
Show Gist options
  • Save kyleondata/3083774 to your computer and use it in GitHub Desktop.
Save kyleondata/3083774 to your computer and use it in GitHub Desktop.
Javascript to handle getting the file
function getDocItems(id) {
$.ajax({
url: "<URL TO GET THE DOCUMENT>?id=" + id,
dataType: "json",
cache: false
}).error(function (jqXHR, textStatus) {
}).success(function (data) {
for (var key in data) {
var html = '<p><a href="<URL TO GET FILE>/GetFile?id=' + data[key].Id + '&type=' + data[key].MimeType + '" >' + data[key].FileName + '</a></p>';
$('#YourElementId').append(html);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment