sending name and description with the file
This commit is contained in:
parent
cd3b196914
commit
3e0818db1c
@ -98,7 +98,10 @@ function show_upload_popup()
|
|||||||
function upload()
|
function upload()
|
||||||
{
|
{
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
|
|
||||||
formData.append('file_upload', $('#file_upload')[0].files[0]);
|
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
|
$.ajax
|
||||||
({
|
({
|
||||||
@ -124,7 +127,7 @@ function upload()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
alert("Neplatná formát!");
|
alert("Neplatný formát!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user