| @@ -189,7 +189,7 @@ function upload_zone_drop(e) { | |||
| if ( temp.documentid == null ) { | |||
| $.post(conf.openapi + "/documents", {}, function(data) { | |||
| console.log(data); | |||
| temp.documentid = data.id; | |||
| handle_uploads(ev); | |||
| }) | |||
| } | |||
| @@ -200,8 +200,7 @@ function upload_zone_drop(e) { | |||
| function handle_uploads(ev) { | |||
| return true; | |||
| 1 | |||
| $.each(ev.dataTransfer.files, function(id,file) { | |||
| var fileid = temp.upload.length(); | |||
| temp.upload.push({ | |||
| @@ -218,9 +217,14 @@ function handle_uploads(ev) { | |||
| } | |||
| else { | |||
| var reader = new FileReader(); | |||
| reader.readAsBinaryString(file); | |||
| reader.onloadend = function() { | |||
| } | |||
| var data; | |||
| reader.onloadend = function(e) { | |||
| $.post(conf.openapi + "/documents/" + temp.documentid + "/data", e.result, function(data) { | |||
| console.log(data); | |||
| }, file.type) | |||
| }; | |||
| reader.readAsArrayBuffer(data); | |||
| } | |||
| }); | |||
| return true; | |||