upload.jsp
4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<%@page import="it.softecspa.portal.ApplicationClusterInfo"%>
<%@page import="it.softecspa.portal.Parameters"%>
<%
Parameters parameters = Parameters.getInstance();
String url = request.getScheme()+"://"+parameters.getChannelInfo().getDomainName();
url += parameters.getChannelInfo().getPortHTTP()+parameters.getChannelInfo().getContextName()+"/proxy-services/statement?upload";
%>
<html>
<head>
<title>Upload file - test page</title>
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<style>
HTML,BODY {
margin-top: 5px;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 5px;
/* http://www.google.com/fonts */
font-family: 'Source Sans Pro', Frutiger, Arial, Helvetica, sans-serif;
/* font-family: Frutiger, Arial, Helvetica, sans-serif; */
font-size: 14px;
font-weight: 400;
background-color: white;
color: black;
height: 100%
}
.tabella {border:solid 1px #DDDDEE; color:#2b2b2b; }
.cella {padding:5px;color:#2b2b2b; background-color:#DDDDEE; font-face:verdana; font-size:14px;}
.cellaIntestazione {padding:5px;color:#2b2b2b; background-color:#DDDDEE; font-face:verdana; font-size:14px; font-weight:bold;}
</style>
<script>
function sendData() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//document.dati.risposta.value="Elaborazione in corso....";
xmlhttp.open("POST", "<%=url%>", false);
xmlhttp.setRequestHeader("X-username", document.dati.FIELD_USERNAME.value);
xmlhttp.setRequestHeader("X-password", document.dati.FIELD_PASSWORD.value);
//
xmlhttp.setRequestHeader("X-path", document.dati.FIELD_PATH.value);
xmlhttp.setRequestHeader("X-fileName", document.dati.FIELD_FILENAME.value);
xmlhttp.setRequestHeader("X-bufferLenght", document.dati.FIELD_BUFFER.value);
if (document.dati.FIELD_OVERWRITE.checked) {
xmlhttp.setRequestHeader("X-overwrite", document.dati.FIELD_OVERWRITE.value);
}
if (document.dati.FIELD_APPEND.checked) {
xmlhttp.setRequestHeader("X-append", document.dati.FIELD_APPEND.value);
}
xmlhttp.send(document.dati.FIELD_REQUEST.value);
var risposta = xmlhttp.responseText;
document.dati.FIELD_RESPONSE.value=risposta;
}
</script>
</head>
<body>
<form name="dati">
<table border="0" cellspacing="1" cellpadding="1" class="tabella">
<tr>
<td class="cella" width="120px"><b>login</b></td>
<td class="cella" ><input name="FIELD_USERNAME" type="text"></td>
</tr>
<tr>
<td class="cella"><b>password</b></td>
<td class="cella"><input name="FIELD_PASSWORD" type="password"></td>
</tr>
<tr>
<td class="cella"><b>path</b></td>
<td class="cella"><input name="FIELD_PATH" type="text"></td>
</tr>
<tr>
<td class="cella"><b>fileName</b></td>
<td class="cella"><input name="FIELD_FILENAME" type="text"></td>
</tr>
<tr>
<td class="cella"><b>overwrite</b></td>
<td class="cella"><input name="FIELD_OVERWRITE" type="checkbox" value="true"></td>
</tr>
<tr>
<td class="cella"><b>append</b></td>
<td class="cella"><input name="FIELD_APPEND" type="checkbox" value="true"></td>
</tr>
<tr>
<td class="cella"><b>bufferLength</b></td>
<td class="cella"><input name="FIELD_BUFFER" type="text"></td>
</tr>
<tr>
<td class="cella" colspan="2"><input type="button" value="Upload" onclick="sendData();"></td>
</tr>
<tr>
<td colspan="2" class="cella">
<div style="display: inline-block; vertical-align: top;">
<div style="display: inline-block; vertical-align: top;"> <b>Input</b><br>
<textarea name="FIELD_REQUEST" cols="80" rows="40"></textarea>
</div>
<div style="display:inline-block; vertical-align: top;"> <b>Response</b><br>
<textarea name="FIELD_RESPONSE" readonly="readonly" cols="50" rows="20"></textarea>
</div>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>