0

I am trying to read multiple images uploaded by the user through HTML page. I am not sure, how the multiple files are handled. I presumed that, the files can be handled as an index but it went wrong. Please find the HTML code below:

<form action="" method=post enctype=multipart/form-data>
  <p><input type=file name="newname" multiple>
     <input type=submit value=License name=submit_button>
</form>

My python code below that I tried:

@app.route("/", methods=['GET', 'POST'])
def index():
    blob=file[0].read()

The error I received is :

TypeError: 'FileStorage' object does not support indexing

Please help me in doing this

Thank you in advance

python_interest
  • 874
  • 1
  • 9
  • 27
  • [here](https://stackoverflow.com/questions/20015550/read-file-data-without-saving-it-in-flask/20017830#20017830) – Pyd Sep 11 '18 at 04:47
  • Hi @pyd..thank you for your response. I am not getting one thing. I am already using file.read(). How can I use it when I get multiple files from the user ? 3 images uploaded and I have to use every single image and process it – python_interest Sep 11 '18 at 05:53
  • 1
    I think `flask.request.files.getlist("file[]")` check [here](https://stackoverflow.com/questions/11817182/uploading-multiple-files-with-flask#11817318) – Pyd Sep 11 '18 at 06:25

0 Answers0