summaryrefslogtreecommitdiff
path: root/web-static/upload.html
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-07-23 01:46:32 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-07-23 01:46:32 (GMT)
commit39fd9dd2c8156c9a9f9abc23e6f5398770e44f5d (patch)
treecd6e6af7387f284f596473dbc97cfa846007a544 /web-static/upload.html
parent732438e3042d299c6dd7c096ba2eaa20035d8466 (diff)
some cleanup and imrpovments (mainly in the javasctipt test sites
Diffstat (limited to 'web-static/upload.html')
-rw-r--r--web-static/upload.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/web-static/upload.html b/web-static/upload.html
new file mode 100644
index 0000000..39cfa57
--- /dev/null
+++ b/web-static/upload.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>rhimportd File Upload</title>
+ <style type="text/css">
+ body {
+ background-color: #555;
+ }
+
+ div.data {
+ background-color: white;
+ border: 1px solid;
+ padding: 1em;
+ font-family: monospace;
+ margin-top: 1em;
+ margin-bottom: 1em;
+ }
+
+ td.label {
+ text-align: right;
+ }
+ </style>
+ <script src="jquery.min.js"></script>
+ <script type="text/javascript">
+ 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,
+ 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);
+
+ }
+
+ function result(data) {
+ $('#result').text(JSON.stringify(data));
+ $('#buttonupload').removeAttr('disabled','disabled');
+ }
+
+ function init() {
+ $('#sessionid').val("");
+ result({})
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div class="container">
+ <h1>rhimportd File Upload</h1>
+ <table>
+ <tr><td class="label">Username</td><td><input id="username" type="text" size="20" value="heslinki" /></td></tr>
+ <tr><td class="label">Session</td><td><input id="sessionid" type="text" size="45" /></td></tr>
+ <tr><td class="label">File</td><td><input id="file" type="file" /></td></tr>
+ <tr><td>&nbsp;</td><td><button id="buttonupload" onclick="upload()">upload</button></td></tr>
+ </table>
+ <div id="result" class="data"></div>
+ </div>
+ </body>
+</html>