-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for POST files and Upload #552
Comments
I just wanted to create new thread for this with a same RFE. Also you can also use FTP server and download data from external server, if this usecase fits your needs (not for mine, since my AP is not working 24/7). |
What I meant is uploading TO the ESP. I used code from PR #499 to be able to read the incoming post request body, but everything goes to the memory. It's not suitable for large files. |
So there are 2 use cases:
|
@ram-one @Vity01 : With current functionality there is probably a workaround. |
This workaround has a big drawback : It needs a webserver on the other side. |
@ram-one : |
I would be interested in this too - but for a different use case scenario: enabling OTA Updates via http post. This way people do not need a webserver of their own and request would never need to leave their own network |
I had a look at the current http server implementation and this is what I found so far/ideas for changes:
But what I did not quite understand from the current design is, if we can receive small packages and then write them to filesystem (form the onReceive method i guess?) |
@patrickjahns :
state being initialized as eHCS_Ready at instantiaton.of the httpserverconnection object. For saving the data you should use a stream, see DataSourceStream.h. That would make it possible to write to a file (FileStream) or when using for OTA a FlashStream (to be made). UPDATE : |
Thank you for the input - I had a closer look at the implementation just now. Here is an example multipart request:
My approach in the testcode is to check in Since this ties directly to the way we parse form data - would it be possible to extend the HttpServer Interface so the when defining the Path via Otherwise I am a bit lost when extending the post to upload a new firmware. (I wouldn`t want to write to spiffs first and then move the rom) |
@patrickjahns For extending to post firmware. There is a base class IDataSourceStream, and a derived class Filestream. My idea is that we add a "write functionality" to the filestream class (like the memorydatastream has) . That provides the way to get the posted file on spiffs. When also adding a derived Flashstream class, which writes directly to flash (no spiffs) we have the same interface for use in the http classes. PS : see the update in the remark above. |
Copying some information from gitter to keep track of it:
Also interesting for HTTP Multipart is RFC2388 |
Closed and move discussion to #694 |
Is there any support for uploading files with POST requests ?
Bonus question : could we update the device with a manual firmware upload ?
The text was updated successfully, but these errors were encountered: