if (e.currentTarget.files && e.currentTarget.files[0]) {
var file = e.currentTarget.files[0];
var chunkSize = Infinity;
var options = {
endpoint: "http://52.66.153.82:8000/uploads",
chunkSize: chunkSize,
metadata: {
filename: file.name,
user_id: "Ankit",
},
header: {
"key":"value"
},
beforeSend: function(xhr){xhr.setRequestHeader('X-Test-Header', 'test-value');},
onError: function(error) {
if (error.originalRequest) {
if (confirm('Failed because: ' + error + '\nDo you want to retry?')) {
options.resume = false;
options.uploadUrl = upload.url;
upload = new tus.Upload(file, options);
upload.start();
return;
}
} else {
alert('Failed because: ' + error);
}
},
onProgress: function(bytesUploaded, bytesTotal) {
var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2);
console.log(bytesUploaded, bytesTotal, percentage + '%');
},
onSuccess: function(data) {
var uploaded_url = upload.url;
var final_url = uploaded_url.replace("8000","4300");
alert(final_url);
var type = file.type;
$("#loader_class").hide();
// var image_url ="http://52.66.153.82:4300/files/"+fina;
console.log("final_urlfinal_url");
console.log(final_url);
$("#image_div").removeClass("div_hide_class");
Session.set("post_type","image");
Session.set("post_image_url",final_url);
$("#loader_class").hide();
$("#post_image").attr("src",final_url);
}
};
upload = new tus.Upload(file, options);
upload.start();
}
}
curl http://localhost:8042/studies/333b2c11-52e9feea-5516186e-ecd61f37-69da2603 curl http://localhost:8042/patients/dc65762c-f476e8b9-898834f4-2f8a5014-2599bc94 bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$ curl http://localhost:8042/patients [ "333b2c11-52e9feea-5516186e-ecd61f37-69da2603", "da39a3ee-5e6b4b0d-3255bfef-95601890-afd80709" ] bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$ curl http://localhost:8042/studies [ "9b5629ef-c28c48db-b3593009-35fda9cb-7a0bb799", "abae0b24-5a718d9e-1b560140-2cda3ae0-30b846cb" ] bird@bird-Lenovo-ideapad-310-15IKB:/media/bird/2AE477A5E4777245/Meteor/OrthancMirror/build$ curl http://localhost:8042/series [ "993a521c-1b11574c-92e1c71d-a048784c-36866be0", "5f19601c-3e5fa872-e566e9f2-36aa3b31-dc719c3e" ] bird@bird-Lenovo-ideapad-310-15IKB:/med...
Comments
Post a Comment