-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.html
More file actions
75 lines (68 loc) · 2.28 KB
/
basic.html
File metadata and controls
75 lines (68 loc) · 2.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic PDF Test</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 50px auto;
padding: 20px;
}
.upload-area {
border: 2px dashed #3498db;
padding: 40px;
text-align: center;
margin: 20px 0;
}
button {
background-color: #3498db;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.results {
margin-top: 20px;
padding: 20px;
background-color: #f8f9fa;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Basic PDF Upload Test</h1>
<div class="upload-area">
<h3>Select PDF files</h3>
<input type="file" id="fileInput" multiple accept=".pdf">
</div>
<div id="results" class="results" style="display: none;">
<h3>Results:</h3>
<div id="resultContent"></div>
</div>
<script>
document.getElementById('fileInput').addEventListener('change', function(e) {
console.log('File input changed');
console.log('Files:', e.target.files);
const files = e.target.files;
if (files.length === 0) {
console.log('No files selected');
return;
}
console.log('Files selected:', files.length);
let html = '<h4>Files selected:</h4><ul>';
for (let i = 0; i < files.length; i++) {
const file = files[i];
console.log('File', i, ':', file.name, file.type, file.size);
html += '<li>' + file.name + ' (' + (file.size / 1024 / 1024).toFixed(2) + ' MB)</li>';
}
html += '</ul>';
document.getElementById('resultContent').innerHTML = html;
document.getElementById('results').style.display = 'block';
});
</script>
</body>
</html>