S
S
symply_rabbit2018-10-15 07:35:46
JavaScript
symply_rabbit, 2018-10-15 07:35:46

How to send data from the input type="file" to a file with Ajax and from there add an image to the property of an element of type file?

or maybe it's better to download it and then get a link somehow ...
I send text type fields by

data: ({name:$('#name').val(), nomer:$('#phone').val(),

is it possible to send images in the same way?
and if so, how then to add a new element of the infoblock to the file type property. text and select are added without problems
$PROP['PHONE'] = $phone;
    $PROP[139][] = array('VALUE' => $select);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Shevchenko, 2018-10-15
@densisss

To send a form with js files, it is better to use formData
https://developer.mozilla.org/en/docs/Web/API/FormData
The rest of the manipulations depend only on you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question