E
E
Evgeny Usachev2022-02-17 19:47:09
AJAX
Evgeny Usachev, 2022-02-17 19:47:09

How to pass file and variable via Ajax?

There is a way to submit a file via ajax using contentType: false, processData: false, data: form_data. I know this way. but I need to pass the same request also a variable. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2022-02-17
@Eugene_Evgeni

Add your variable to FormData: Before submitting.
form_data.append('key', 'value');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question