Auto commit: 2025-11-20T12:39:07.935Z
This commit is contained in:
parent
a04ddd5be8
commit
4480b6fac8
@ -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();
|
||||
|
||||
BIN
assets/pasted-20251120-123736-8179929a.png
Normal file
BIN
assets/pasted-20251120-123736-8179929a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 320 KiB |
@ -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">
|
||||
|
||||
@ -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 {
|
||||
|
||||
BIN
uploads/doc_691f0ae04935d.jpg
Normal file
BIN
uploads/doc_691f0ae04935d.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 355 KiB |
BIN
uploads/doc_691f0b64179e7.jpg
Normal file
BIN
uploads/doc_691f0b64179e7.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 355 KiB |
Loading…
x
Reference in New Issue
Block a user