Help with a (probably) simple HTML question from someone knowledgeable...
ags
Posts: 386
I'm not an HTTP or HTML expert - but I seem to be impersonating one lately with my Spinneret project(s).
I have a small server up and functioning for my purposes, including a bootloader. It's still rough, though, and I have to "push" binary images to the server using Curl (see curl.haxx.se). This sends an HTTP "PUT" request, waits for a "100 Continue" response, then sends the binary image. That's fine - but it's cumbersome and clumsy. I have read the RFC and other specs (not in its entirety) and have searched for info on using HTML FORMs.
Isn't there an easy way to use FORMs on the page the Spinneret is serving, allowing the user to enter a filename and then click on a "Download" button? This would then ideally send a response to the PC/host, which would then send the file (if it exists on the PC/host) in the same way as curl, with a PUT response, wait for a 100 Continue, then send the packets. This way curl is not needed, it's all initiated from the Prop/Spinneret web page, and it is much neater.
Can anyone help with creating this HTML FORM (or some other way)?
Thanks.
I have a small server up and functioning for my purposes, including a bootloader. It's still rough, though, and I have to "push" binary images to the server using Curl (see curl.haxx.se). This sends an HTTP "PUT" request, waits for a "100 Continue" response, then sends the binary image. That's fine - but it's cumbersome and clumsy. I have read the RFC and other specs (not in its entirety) and have searched for info on using HTML FORMs.
Isn't there an easy way to use FORMs on the page the Spinneret is serving, allowing the user to enter a filename and then click on a "Download" button? This would then ideally send a response to the PC/host, which would then send the file (if it exists on the PC/host) in the same way as curl, with a PUT response, wait for a 100 Continue, then send the packets. This way curl is not needed, it's all initiated from the Prop/Spinneret web page, and it is much neater.
Can anyone help with creating this HTML FORM (or some other way)?
Thanks.
Comments
http://24.253.241.231:3456/
The browser renders the html controls (See Beau's example). You just browse to the file and click a submit button. You'll see the the file content in the body of the post request on the server side. The browser does not wait for a "100 continue" though.
Yes, that is exactly the UI that I'm looking for. That's very user-friendly. Is the code available, if not for re-use at least as a tutorial/example?
I did search and found some references to multipart/form-data stuff, but it looked like a lot of messy parsing - and I'm trying to minimize the memory footprint on the Prop/Spinneret.
Sure, here is the code... Most of the DEMO code is proof of concept getting key building blocks marked off.