This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220: CC3220 http server file upload

Part Number: CC3220


Hi all,

I'm developing a web page running on the http server that I'll use to make the initial provisiong of the system. I'm not using the native provisiong api cause I need to set other parameters also apart the classic network configuration, and between these parameters I need to upload to the device some files (certificates provisioned by the end user like that I can't flash in production time). How can I obtain this using the http server? Client side I could use a post form with the enctype="multipart/form-data",  but server side (the cc3220) how can I manage this? The received file should be write inside the file system.

Thanks

Riccardo

  • Hi Riccardo,

    You'll need to write the files you receive to the file system. I'd suggest reviewing the Secure File System SimpleLink Academy for an overview of the file system and how to read/write to it.

    dev.ti.com/.../

    Have you already looked through the http_get example within the SDK? Section 8.6 & 8.7 of www.ti.com/.../swru455e.pdf has good information regarding http GET/POST processing.

    Hope this helps,
    Kevin
  • Hi Kevin,

    I already saw the httpget example but it is a client running on the device that execute a http get to an external server. I need the device is the server that receive the file from an external client like a pc. However, about what you told me, I have to manage manually the chunks received from the http posts and save them (extracting the payload) on the file system, is this correct? I've seen that using a multilpart/form content-type, the client should send http posts placing the file to upload content inside the posts body.

    Thanks

    Riccardo
  • Hi Riccardo,

    The HTTP Server section in the Programmer's Guide may be useful to you: http://www.ti.com/lit/swru455

    It goes over the different REST APIs that can be handled by the internal HTTP server as well as how unrecognized POST/GET/etc requests are processed.

    Another way you could look into is sending all your files Over-the-Air. There is an OTA update example within the SDK and an Application Report available online for further details/explanation.

    Hope this helps,
    Kevin