-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
35 lines (32 loc) · 1.19 KB
/
form.html
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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>File Upload Test</title>
</head>
<body>
<form method="POST" action="upload" enctype="multipart/form-data">
<p><input id="vin" name="vin" type="text" value="" placeholder="VIN"></p>
<p><input id="timestamp" type="hidden" name="timestamp"></p>
<p><input id="key" type="hidden" name="key"></p>
<p><input type="file" name="fileUploaded" multiple></p>
<p><button id="submit" type="submit">Upload</button></p>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function generateUUID(){
var d = new Date().getTime();
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
}
$("#submit").on("click", function () {
$("#timestamp").val(new Date().getTime());
$("#key").val(generateUUID());
$("form").submit();
});
</script>
</body>
</html>