V
V
Vladislav1052021-04-11 19:47:54
AJAX
Vladislav105, 2021-04-11 19:47:54

How to send image to jquery ajax handler?

There is this form:

<h1>Добавить статью</h1>
    <label><p>Название</p><input class="article_title" type="text"></label>
    <label><p>Текст статьи</p><textarea class="article_text"></textarea></label>
    <label><p>Картинки</p><input name="userfile[]" type="file" multiple="true"></label>
    <label><p>Интро</p><input name="userfile[]" type="file"></label>

How to send image from input to php file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kudrya, 2021-04-11
@Vladislav105

FormData

T
ThunderCat, 2021-04-11
@ThunderCat

for starters, wrap the fields in a form tag, although this is not necessary, but it is more convenient to work with data.
Next, google "upload ajax files"/"send files ajax" .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question