Skip to content

Instantly share code, notes, and snippets.

@devloe
Last active May 2, 2018 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devloe/ce5600bd6a360c8ea4a31c0851a75176 to your computer and use it in GitHub Desktop.
Save devloe/ce5600bd6a360c8ea4a31c0851a75176 to your computer and use it in GitHub Desktop.
const queryParams = "...........&type=ATTACHMENT&filename=" + fileName;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Action to be performed when the document is read;
}
};
xhttp.open("PUT", "https://www.mediktor.com/dev/uploads/File.Upload?" + queryParams, true);
xhttp.setRequestHeader("Authorization", "Basic " + this.authCode);
xhttp.setRequestHeader("Content-Type", "application/octet-stream");
xhttp.send(fileContent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment