1 |
|
---|
2 |
|
---|
3 | <div>
|
---|
4 |
|
---|
5 | @Html.Partial("Navbar", new HeuristicLab.Clients.Hive.WebJobManager.ViewModels.NavbarViewModel("Job"))
|
---|
6 |
|
---|
7 |
|
---|
8 | <div style="margin:10px">
|
---|
9 |
|
---|
10 | <form method="post"
|
---|
11 | asp-action="Upload"
|
---|
12 | asp-controller="Job"
|
---|
13 | enctype="multipart/form-data">
|
---|
14 | <input onchange="printFiles()"
|
---|
15 | type="file"
|
---|
16 | id="files"
|
---|
17 | name="files"
|
---|
18 | multiple
|
---|
19 | accept=".hl"
|
---|
20 | style="display:none" />
|
---|
21 |
|
---|
22 | <div onclick="firefilebutton()"
|
---|
23 | class="btn btn-info btn-lg btn-block ">
|
---|
24 | Choose file(s)
|
---|
25 | </div>
|
---|
26 |
|
---|
27 | <div class="row"
|
---|
28 | style="margin:10px">
|
---|
29 | <div id="selectedfiles"></div>
|
---|
30 | <div style="visibility:hidden; margin-bottom:10px;"
|
---|
31 | id="del"
|
---|
32 | class='btn btn-danger'
|
---|
33 | onclick='deletefiles()'>
|
---|
34 | <span class='glyphicon glyphicon-trash'
|
---|
35 | aria-hidden='true'></span> Remove files
|
---|
36 | </div>
|
---|
37 | <input style="visibility:hidden;"
|
---|
38 | id="upl"
|
---|
39 | class="btn btn-lg btn-block btn-success"
|
---|
40 | type="submit"
|
---|
41 | value="Check contents" />
|
---|
42 | </div>
|
---|
43 |
|
---|
44 | </form>
|
---|
45 | </div>
|
---|
46 |
|
---|
47 | <script type="text/javascript">
|
---|
48 | function printFiles() {
|
---|
49 | var div = document.getElementById("selectedfiles");
|
---|
50 | var files = document.getElementById("files").files;
|
---|
51 | div.innerHTML = "";
|
---|
52 | if (files.length > 0) {
|
---|
53 | document.getElementById("upl").style.visibility = "visible";
|
---|
54 | document.getElementById("del").style.visibility = "visible";
|
---|
55 |
|
---|
56 | div.innerHTML += "<h3>Files</h3>";
|
---|
57 | for (var i = 0; i < files.length; i++) {
|
---|
58 | div.innerHTML += "<p>File " + (i + 1) + ":" + files[i].name +
|
---|
59 | "</p>";
|
---|
60 | }
|
---|
61 |
|
---|
62 | }
|
---|
63 | else {
|
---|
64 | document.getElementById("upl").style.visibility = "hidden";
|
---|
65 | document.getElementById("del").style.visibility = "hidden";
|
---|
66 | }
|
---|
67 |
|
---|
68 | }
|
---|
69 | function firefilebutton() {
|
---|
70 | document.getElementById("files").click();
|
---|
71 |
|
---|
72 | }
|
---|
73 | function deletefiles() {
|
---|
74 | var filesarr = document.getElementById("files").files;
|
---|
75 | document.getElementById("files").value = "";
|
---|
76 | printFiles();
|
---|
77 | }
|
---|
78 | </script>
|
---|
79 | </div> |
---|