This example demonstrates how to upload multiple files on the server.
About HTTP server file upload
The HTTP server coming with Sming is quite powerful but it is limited by available hardware resources.
This sample demonstrates how to use the Multipart Parser library to enable file upload of the HTTP server. On a normal computer the file uploads are usually using temporary space on the hard disk or in memory to store the incoming data.
On an embedded device that is a luxury that we can hardly afford. In this sample we demonstrate how to define which file upload fields should be recognized and what (file) streams are responsible for processing and storing the data. If a field is not specified then its content will be discarded.
Configure your flash memory layout. See Hardware configuration.
Build the example by running:
Connect your device via USB/Serial cable and run:
to install the example firmware.
Point the browser to your device’s IP address to open the firmware upgrade page.
Select the upload file and hit the “Update” button.
If the file size isn’t bigger than the MAX_FILE_SIZE defined in the application code you should see a confirmation that the upload was successful.