cancel
Showing results for 
Search instead for 
Did you mean: 

Having issues getting POST (upload file from web browser) to work in an STM32F407 project

MStra.3
Associate III

We have a custom board with an STM32F407 on it. I used CubeMX to create the project and enabled HTTPD. I used the example LwIP_HTTP_Server_Netconn to get a webserver running. I have a few pages working including a dynamic page. Next step was to create a page that would allow the user to Submit a file to upload to the webserver. I used the In Application Programming example for the STM324xG_EVAL board to get ideas on how to do this. The big difference is that it does not use netconn... Everything is fine until I press submit on the page, then the following happens:

  1. If you submit with no file chosen my code detects this and then does a netconn_write of the same page. Then it closes the connection and deletes the netbuf. When this happens I see from Wireshark that the first packet is sent out to refresh the page but it takes 3 packets and the other two never go out to the browser. I then see keepalive requests and responses from the browser and webserver after this.
  2. It gets stuck when you actually submit a file but I haven't really tried to debug this yet.

I am a newbie to LWIP and webservers. I have found it near impossible to find good tutorials on how this stuff works. Any help would be appreciated 😀

Mike.

1 ACCEPTED SOLUTION

Accepted Solutions
MStra.3
Associate III

I figured this out. The code I started with closed the connection after every receipt of data. The connection must be kept open during the entire POST.

Mike.

View solution in original post

1 REPLY 1
MStra.3
Associate III

I figured this out. The code I started with closed the connection after every receipt of data. The connection must be kept open during the entire POST.

Mike.