Having issues getting POST (upload file from web browser) to work in an STM32F407 project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-21 4:39 PM
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:
- 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.
- 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 :grinning_face:
Mike.
Solved! Go to Solution.
- Labels:
-
Ethernet
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-06 3:39 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-06 3:39 PM
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.
