A
A
alex_1242020-07-30 12:39:28
Python
alex_124, 2020-07-30 12:39:28

How to upload a file to the server (on python 3.8.5) via html form?

Hello! Created the logic for parsing the pdf file. Now I want to implement uploading a file via form to the server for parsing and writing to the Postgres database. The only problem is that I don’t understand how to upload the file and I can’t find it in the open
doc = fitz.open(pdf_document) # Открытие док-та

<form action="registration.py" method="POST">
  <div class="form-group">
  <label for="doc">Загрузите файл</label>
  <input type="file" class="form-control-file" id="doc">
  </div>
  <button type="submit" class="btn btn-outline-primary">Go!</button>
</form>


These are sections of code that are responsible for loading. The Python code is very long, but this line is responsible for opening what is presented

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex_124, 2020-07-31
@alex_124

Thank you very much for the detailed answer
. Actually, I didn’t want to make a decision through php, and I didn’t know such a catch :) I’ll go and
see what tutorials there are

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question