S
S
strager12020-10-13 10:36:32
Qt
strager1, 2020-10-13 10:36:32

How to upload a file from a computer to the controller's web server?

There is a controller with a lighttpd web server. It also deployed a cgi program in c++ using qt, which creates a web interface.
It is necessary to make it so that the user can select a file from the browser, and this file is loaded into the controller. The entire Internet has already been rummaged, but everywhere in the examples the program is deployed on a computer and transmits data to a remote web server, and here the program is deployed on the controller, because of this, of course, nothing works. The only thing I found is that you may need to use the QHttpMultiPart class, but there are also no intelligible examples.

File selection page:

<h2>Загрузка ПО</h2>
<form enctype="multipart/form-data" action="cgi?downloadpost" method="post">
<fieldset><label> Укажите путь к загружаемому файлу <input name="g1" type="file"></label></fieldset><p>&nbsp;</p><p align=right><input type="submit" name="button" value="Загрузить" />
</p></form>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question