Auto commit: 2025-11-20T12:39:07.935Z

This commit is contained in:
Flatlogic Bot 2025-11-20 12:39:07 +00:00
parent a04ddd5be8
commit 4480b6fac8
6 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,9 @@ document.addEventListener('DOMContentLoaded', function () {
processingMessage.style.display = 'none';
if (data.success && data.filePath) {
uploadedFilePath = data.filePath;
const fileExtension = uploadedFilePath.split('.').pop().toLowerCase();
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'tiff', 'bmp', 'webp'];
const imagePreview = document.getElementById('image-preview');
@ -52,7 +54,7 @@ document.addEventListener('DOMContentLoaded', function () {
pdfPreview.style.display = 'none';
if (imageExtensions.includes(fileExtension)) {
imagePreview.src = uploadedFilePath;
imagePreview.src = uploadedFilePath + '?t=' + new Date().getTime();
imagePreview.style.display = 'block';
} else if (fileExtension === 'pdf') {
pdfFilename.textContent = uploadedFilePath.split('/').pop();

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View File

@ -38,6 +38,7 @@
</header>
<main class="container my-5">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="translation-box">

View File

@ -50,6 +50,7 @@ $file_name = uniqid('doc_') . '.' . $file_extension;
$target_path = $upload_dir . $file_name;
if (move_uploaded_file($file['tmp_name'], $target_path)) {
$web_path = '/uploads/' . $file_name;
json_response(true, 'File uploaded successfully.', $web_path);
} else {

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB