Assuming you're passing the same origin policy and that your browser supports XMLHttpRequest, Blob, FormData
function getThenUpload(fromURL, toURL) {
var xhrFrom = new XMLHttpRequest();
xhrFrom.onload = function () {
var xhrTo = new XMLHttpRequest(),
formData = new FormData(); // make file have <form> style
formData.append('file', this.response); // set "name, value" of "<input>"
xhrTo.open('POST', toURL);
xhrTo.send(formData); // upload file
}
xhrFrom.open('GET', fromURL);
xhrFrom.responseType = 'blob'; // expecting file
xhrFrom.send(); // download file
}
getThenUpload('/file.txt', 'upload.php'); // start