I have and Arduino Mega 2560 and an Arduino Ethernet Shield with a 4GB SDHC card installed. To experiment with this I have been playing with the ethernet library to produce both a web client and server and I thought it would be an interesting challenge to try to pass a file from a browser to the SDHC card on the ethernet shield.
So far I have the server working fine, the html form to produce a browse dialog box and upload button but I have been unable to find a way to pass the file or it's address from this to my firmware. My current objective is to somehow get this information to the firmware so that t can be processed and written to the card.
Does anyone have any suggestions, ideas or pointers on how to do this?
What I am stuck with is how to pass the selected file to the arduino. All this does is open a file select window, it's the next bit I can't seem to work out.
The action="upload" is just a place holder. This is where I need to put in the code to stream the file to the arduino.
You know this really isn't an Arduino issue, right? It's a basic form processing issue.
When the Upload button is pushed, the upload function is called. Typically, that is a cgi script, but it could be an application, a php script, a python script, etc.
That script needs to open the file, and stream the contents back to the server.