Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Obviously µC/HTTPs requires a file system for reading files. We suggest using a conventional File system implementation such as µC/FS. This will allow you to dynamically load the web pages and enable your web server to receive files. However, µC/HTTPs comes with a minimalist in-house Static File system which only stores static files (stored in the code space memory). Obviously, it is only possible to read them and thus not possible to upload files to a web server when the static file system is used.

 

µC/HTTPs uses the API's defined by µC/TCP-IP Network File System Abstraction Layer (net_fs.h) to access the file system. It is possible to use µC/HTTPs with other file systems by providing an appropriate implementation of the µC/TCP-IP Network File System Abstraction Layer. Example template files to port the file system are available in the µC/TCP-IP Network File System Abstraction Layer directory.

 

Transferring files to use with µC/HTTPs

Transferring files on the file system for use with the µC/HTTPs module is outside the scope of this document. For this purpose, you could use a FTP server or client, such as µC/FTPs or µC/FTPc, or again use a mass storage media to into your file system.

Note that µC/HTTPs can support file upload when a traditional file system is used. Thus it’s possible to create script to transmit files using the POST method even if no file is yet loaded.


Using µC/HTTPs with the static file system

µC/HTTPs provides a small file system that could be allow it to be used without a conventional file system.

The static file system relies on C arrays to represent the various files, and those files are accessible only for reading. µC/HTTPs ships with a very basic web page consisting of a gif and two html files. If you wish to include your own files in this file system, you will have to follow a few simple steps.

First of all, you will have to download a small utility called bin2c.exe from Micrium’s web site to help you create a C array from any given file. You need to create these arrays for every single file you want to include in this file system. Type bin2c.exe /? at the command prompt for more information on its usage.

The C array having been generated by this utility then have to be included into your project’s application (see file static_files.h for complete example). Finally, prior to being able to access the files on the static file system, you need to initialize it and add the files to it, just like it is being done in the listing below.

Static File System Module Configuration

A template for the configuration of the static file system is provided in uC-HTTPs\FS\Static\Cfg\Template\https_fs_static_cfg.h. If the static file system is being used with µC/HTTPs, the configuration file have to be copied into your application directory and included to your project.

#define HTTPs_FS_CFG_ARG_CHK_EXT_EN       DEF_ENABLED

This value configures external argument check feature. You may enable this feature by setting it to DEF_ENABLED or to DEF_DISABLED otherwise.

#define HTTPs_FS_CFG_NBR_FILES            5

This value defines the maximum number of files the static file system could manage.

#define HTTPs_FS_CFG_NBR_DIRS             5

This value defines the maximum number of directory the static file system could manage.

#define HTTPs_FS_CFG_MAX_FILE_NAME_LEN    25

This value defines the maximum file name length.


  • No labels