summaryrefslogtreecommitdiff
path: root/web-static
diff options
context:
space:
mode:
Diffstat (limited to 'web-static')
-rw-r--r--web-static/socket.html4
-rw-r--r--web-static/upload.html11
2 files changed, 6 insertions, 9 deletions
diff --git a/web-static/socket.html b/web-static/socket.html
index 9781e81..6d6236c 100644
--- a/web-static/socket.html
+++ b/web-static/socket.html
@@ -66,8 +66,10 @@
$('#rawmsg').text("");
this.sock = new WebSocket("ws://localhost:4080/public/socket");
this.sock_onmessage = function (event) {
- $('#rawmsg').append(event.data + "\n");
msg = $.parseJSON(event.data)
+ if (msg.TYPE != "progress") {
+ $('#rawmsg').append(event.data + "<br />\n");
+ }
switch (msg.TYPE) {
case "ack":
$('#sessionid').val(msg.ID);
diff --git a/web-static/upload.html b/web-static/upload.html
index 39cfa57..21d1c48 100644
--- a/web-static/upload.html
+++ b/web-static/upload.html
@@ -26,21 +26,16 @@
function upload() {
$('#buttonupload').attr('disabled','disabled');
- var cmdData = new FormData();
- cmdData.append("LOGIN_NAME", $('#username').val());
- cmdData.append("SESSION_ID", $('#sessionid').val());
- cmdData.append("FILENAME", $('#file').get(0).files[0]);
var command = {
type: "POST",
- contentType: false,
+ contentType: "application/octet-stream",
+ data: $('#file').get(0).files[0],
processData: false,
- data: cmdData,
dataType: 'json',
error: function(req, status, err) { result({StatusText: status, ErrorString: err}); },
success: function(data, status, req) { result(data); }
};
- $.ajax('/public/upload', command);
-
+ $.ajax('/public/upload/' + $('#username').val() + '/' + $('#sessionid').val(), command);
}
function result(data) {