L
L
Lavrov952019-02-19 23:40:44
Python
Lavrov95, 2019-02-19 23:40:44

How can I attach files to input type=file?

<input type="file" name="images[]" id="images" class="custom-file-input" multiple="multiple">

i have var images where are stored
5c6c68f529251385431106.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Yarkov, 2016-09-03
@Tinord

5 requests per second - server limit

Well then, pause the cycle
import time
time.sleep(2)

S
Stalker_RED, 2019-02-19
@Stalker_RED

No way.
You can reset the input type=file, you can read files already selected by the user from it, but you can't add anything.
To send to the server, you can use FormData, followed by forwarding using AJAX.
https://developer.mozilla.org/ru/docs/Web/API/Form...

K
killerdr, 2019-02-19
@killerdr

Before using this field, you must do the following in the form:
set the method for sending data POST (method="post");
set the enctype attribute to multipart/form-data.

<form enctype="multipart/form-data" method="post">
   <p><input type="file[]" name="f">
   <input type="submit" value="Отправить"></p>
  </form>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question