sending name and description with the file

This commit is contained in:
Václav Šmejkal 2024-05-24 17:00:06 +02:00
parent cd3b196914
commit 3e0818db1c
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -98,7 +98,10 @@ function show_upload_popup()
function upload()
{
let formData = new FormData();
formData.append('file_upload', $('#file_upload')[0].files[0]);
if ($('input[name="name"]').val().trim() != "") formData.append('name', $('input[name="name"]').val());
if ($('input[name="desc"]').val().trim() != "") formData.append('desc', $('input[name="desc"]').val());
$.ajax
({
@ -124,7 +127,7 @@ function upload()
break;
case 3:
alert("Neplatná formát!");
alert("Neplatný formát!");
break;
}
}