Answer the question
In order to leave comments, you need to log in
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
Add your variable to FormData:
Before submitting.
form_data.append('key', 'value');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question