Skip to content

Commit 832003c

Browse files
committed
adding a second file input to the form breaks the upload
1 parent b4a86a8 commit 832003c

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

WebContent/index.html

+19-7
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,34 @@
88
</head>
99
<body>
1010
<form id="file_upload" action="upload" method="POST" enctype="multipart/form-data">
11-
<input type="file" name="file" multiple>
11+
<input type="file" name="file1" id="file1" multiple>
1212
<button>Upload</button>
1313
<div>Upload files</div>
14+
15+
<!-- This breaks the upload -->
16+
<input type="file" name="file2" id="file2" multiple>
17+
<button>Upload</button>
18+
<div>Upload files</div>
19+
<!-- -->
1420
</form>
15-
<table id="files"></table>
21+
<table id="file1_files"></table>
1622

1723
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
1824
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
1925
<script src="fileupload/jquery.fileupload.js"></script>
2026
<script src="fileupload/jquery.fileupload-ui.js"></script>
2127
<script>
22-
/*global $ */
23-
$(function () {
28+
29+
$(document).ready(function() {
30+
initUpload('file1');
31+
});
32+
33+
function initUpload(uniqueId) {
2434
$('#file_upload').fileUploadUI({
25-
uploadTable: $('#files'),
26-
downloadTable: $('#files'),
35+
namespace: uniqueId,
36+
fileInputFilter: '#' + uniqueId,
37+
uploadTable: $('#'+ uniqueId + '_files'),
38+
downloadTable: $('#'+ uniqueId + '_files'),
2739
buildUploadRow: function (files, index) {
2840
return $('<tr><td>' + files[index].name + '<\/td>' +
2941
'<td class="file_upload_progress"><div><\/div><\/td>' +
@@ -36,7 +48,7 @@
3648
return $('<tr><td>' + file.name + '<\/td><\/tr>');
3749
}
3850
});
39-
});
51+
}
4052
</script>
4153

4254
</body>

0 commit comments

Comments
 (0)