Network Component  Version 7.11.0
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HTTP Upload

The HTTP Upload example gives a web based interface to the SD card that is attached to a development board. The user is able to list the contents of the memory card and to upload files to it. The following picture shows an exemplary connection of the development board and a Computer.

http_upload_setup.png

The Abstract.txt file contained in the Documentation group of the Project window gives you more information on the general setup and the available I/O of the development board.

Build the "HTTP Upload" Project

Open the example project in MDK (the web page explains how to do this). The ┬ÁVision Project window should display a similar project structure:

http_upload_proj_structure.png
HTTP Upload Project Structure

Source Files

  • HTTP_Upload.c contains the main C function that initializes the board hardware and the Network Component.
  • The HTTP_Server_CGI.c defines the functions for the scripting language for communication with the hardware.
  • Web.c is a compiled file that will be generated by the tool from all the web input files.
  • The Web files group contains all the HTML and CGI files that will be compiled into the Web.c file. The files in this group determine the actual layout of the web page and the behaviour of the different subpages using CGI.

You may now build and download the example project to the evaluation board using the ┬ÁVision commands:

  • Project –> Build target
  • Flash –> Download

After these steps, the project should start executing on your evaluation kit. In case of errors, refer to the Evaluation Board User's Guide for configuration information.

Using the "HTTP Upload" Project

Hardware Setup

The setup of the Evaluation Board hardware is described in the Abstract.txt file.

  • Verify all jumper settings on the target hardware.
  • Use an Ethernet cable to connect your development board to the local area network. The PC is assumed to be already in this LAN.

PC Software

The web server can be tested on any PC using any browser available. Simply, type in the Local Host Name that is defined in the Net_Config.c file. If you have a DCHP server in your network, you will be automatically connected. You need to log in. As for all network examples, use "admin" (without the quotes) for the user and no password (you can change the defaults in the Net_Config_HTTP_Server.h file). The following (or a similar) page will come up in your browser:

http_upload_frontpage.png

If you get an error message, please verify that all network, IP and other settings are correct.