stm32h743网络服务器如何从浏览器下载文本文件

发布于 2025-01-11 12:17:12 字数 566 浏览 1 评论 0原文

我已经设置了一个 STM32H743 nucleo 网络服务器,它可以通过在浏览器上显示一个小网页来正常工作(我使用的是 LWIP+CubeIDE)。

我可以通过 CGI(见下文)向网络服务器发出简单的命令,从而将一些内容打印到串行端口。 不幸的是,我似乎找不到一种方法将文件从浏览器下载到网络服务器,然后再下载到STM32的串行端口。我不需要存储这些数据,只需将其传递到端口即可。正如您所看到的,我不是专家,但是有人可以为我指出正确的方向,以最简单的方法做到这一点吗?我真的不想添加任何更多的硬件。

const char * valueCGIhandler(int iIndex, int iNumParams, char *pcParam[], char *pcValue[])
{
 uint32_t i=0;

 if (iIndex == 0)
   {
    
     if( strstr((*pcParam),"SETPOINT"))
     {  
         Println(&huart3,*pcValue);
     }
        
     }

 return "/index.shtml";
} 

I have set up an STM32H743 nucleo webserver which works OK by presenting a small webpage on a browser (I am using LWIP+CubeIDE).

I can give the webserver simple commands via CGI (see below) and thereby print something to the serial port.
Unfortunately, I cannot seem to find a way download a file from the browser to the webserver and onwards to the serial port of the STM32. I don't need to store this data, just pass it through to the port. I am not an expert as you can see, but could someone point me into the right direction as regards the simplest way to do this? I don't really want to add any more hardware.

const char * valueCGIhandler(int iIndex, int iNumParams, char *pcParam[], char *pcValue[])
{
 uint32_t i=0;

 if (iIndex == 0)
   {
    
     if( strstr((*pcParam),"SETPOINT"))
     {  
         Println(&huart3,*pcValue);
     }
        
     }

 return "/index.shtml";
} 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文