81 lines
3.2 KiB
PHP
81 lines
3.2 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="pt-BR">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Upload de Arquivos</title>
|
|
<script>
|
|
function addViewportDimensions() {
|
|
var form = document.getElementById('uploadForm');
|
|
var vw = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
|
var vh = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
|
var inputWidth = document.createElement('input');
|
|
inputWidth.type = 'hidden';
|
|
inputWidth.name = 'viewport_width';
|
|
inputWidth.value = vw;
|
|
form.appendChild(inputWidth);
|
|
|
|
var inputHeight = document.createElement('input');
|
|
inputHeight.type = 'hidden';
|
|
inputHeight.name = 'viewport_height';
|
|
inputHeight.value = vh;
|
|
form.appendChild(inputHeight);
|
|
|
|
var userAgent = navigator.userAgent;
|
|
var inputUserAgent = document.createElement('input');
|
|
inputUserAgent.type = 'hidden';
|
|
inputUserAgent.name = 'user_agent';
|
|
inputUserAgent.value = userAgent;
|
|
form.appendChild(inputUserAgent);
|
|
|
|
var language = navigator.language || navigator.userLanguage;
|
|
var inputLanguage = document.createElement('input');
|
|
inputLanguage.type = 'hidden';
|
|
inputLanguage.name = 'language';
|
|
inputLanguage.value = language;
|
|
form.appendChild(inputLanguage);
|
|
|
|
var files = document.getElementById('files').files;
|
|
var modificationTimes = [];
|
|
|
|
for (let i = 0; i < files.length; i++) {
|
|
const file = files[i];
|
|
const lastModified = file.lastModified ? file.lastModified : '';
|
|
modificationTimes.push(lastModified);
|
|
}
|
|
|
|
var inputModification = document.createElement('input');
|
|
inputModification.type = 'hidden';
|
|
inputModification.name = 'modification_times';
|
|
inputModification.value = modificationTimes.join(',');
|
|
form.appendChild(inputModification);
|
|
}
|
|
|
|
window.onload = function() {
|
|
var form = document.getElementById('uploadForm');
|
|
form.onsubmit = function(event) {
|
|
addViewportDimensions();
|
|
}
|
|
|
|
var fileInput = document.getElementById('files');
|
|
fileInput.addEventListener('change', function() {
|
|
var existingInputs = document.querySelectorAll('input[name="modification_times"]');
|
|
existingInputs.forEach(function(input) {
|
|
input.remove();
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h2>Upload de Arquivos</h2>
|
|
<form id="uploadForm" action="./prova/upload.php" method="post" enctype="multipart/form-data">
|
|
<label for="files">Selecione os arquivos para autenticar:</label><br><br>
|
|
<input type="file" name="files[]" id="files" multiple required><br><br>
|
|
<button type="submit">Autenticar</button>
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|