How to Prepare Content to Share
Where the Content is located
Any file placed in the server's Root Folder can be accessible by web browser. Root Folder is the folder on your hard disk, portable or mobile device the server "shows" files from. Copying files to Root Folder is enough to make the files available to web browsers. The folder/file structure under the "root" can be multilevel; Mobile Web Server will use the structure accordingly.
The server's root in the Free version is predefined and located in:
  • installation-folder\MobileWebServer\htdocs (for Portable version);
  • My Documents\MobileWebServer (for mobile devices version);
The Plus version allows the server's root customization.
Note for the Portable version:
If "Documents and Settings" is chosen as the root folder, Mobile Web Server will use the folder as the root regardless of the folder physical location. So, running Mobile Web Server on a different PC (connecting USB flash driver with Mobile Web Server installed to a different PC, for instance) "Documents and Settings" will be switched to new physical location correctly and implicitly. The Plus version supports shortcuts to files and folder also.
If a file is located in the-server's-root\AFolder\AFile.txt, the file will be accessible via http://the-server-link/AFolder/AFile.txt. So, MyPicture.jpg can be accessible as http://the-server-link/MyFolder/MyPicture.jpg if located in the-server's-root\MyFolder\MyPicture.jpg, for instance.
If the files/folders in the server's root are added/deleted/renamed browser refresh is required to reflect the changes.
How the Content is Presented
The common Mobile Web Server logic is:
  • If web browser is navigated to a file the file will be shown (File Mode);
  • If web browser is navigated to a folder:
    1. If the folder does not include (in the order) index.html, index.htm, default.html or default.htm the Server will show files list of the folder (Directory Mode) with auto generated gallery/thumbnails for pictures (excepting mobile versions) and will follow shortcuts (the Plus version only);
    2. If the folder includes a file from the list, the Server shows the file (File Mode);
All the files/folders with names started from '.' (dot) are invisible for web browsers, dot prefixed names can be used to create complex site content.
File Mode
The way Mobile Web uses to expose the files to web browsers depends on file type.
HTML and HTM files are exposed "as is" and listed in the file navigation auto generated menu always, the menu lists the other files/subfolders of the current folder making the navigation through the files easier. HTML/HTM files can be created manually, by a web editor or using an editing program (ex Microsoft Word). Many file editors allow saving documents "as html", so no special web related skills are required for the full scale content creation.
Note: A small footer is added to each shown page automatically by the Free edition.
If a regular text (.txt) file is renamed as HTML/HTM, Mobile Web Server will create the web page from the file automatically, on-the-fly. The feature allows creating the web content with any text editing program. The navigation menu will be generated automatically and accordingly.
All the other file types are treated "as is". The way web browser displays the related pages depends on the browser type and installed components/plugins. Mobile Web Servers just transfers the files "as is". Web browser is responsible for files representation completely. Spreadsheets (for instance) can be shown by browser "in-place", in a separate/dedicated window or can not be shown at all depending on whether a related spreadsheet editor/viewer is installed on the web visitor's computer. Pictures are shown by browsers mostly always.
Directory Mode
The Directory Mode displays subfolders of a navigated folder, files and pictures of the folder. The pictures are shown with auto generated thumbnails/gallery (excepting mobile versions). Copying image files to a folder creates photo album from the pictures automatically. The image files can be distributed through a set of folders making the album more structured.
Note: A small footer is added to each displayed page automatically with the Free edition.
Content Templates (Plus version only)
The File and Directory modes of the server are implemented via so called templates. Plus version allows the template customization. The Free edition utilizes the predefined templates only. The templates determine colors, fonts and placement of displayed page parts - menus, titles, headers, footers etc. The templates are specific HTML files actually; some HTML skills are required for the templates customization.
There are two types of the templates: file templates ('.file' files) and folder templates ('.dir' files). The templates work for a directory they are located in ONLY. The template files have to be distributed through a folder structure to make the folders displayed equally . If a (file or directory) template file is not found in a folder, the default/embedded template will be used instead. Creating empty template files suppresses the template feature.
The templates (see template samples in the "demo" site of MobileWebServer installation) are regular HTML files with special HTML tags added. The additional tags are placeholders to point to subfolder list location, file list location, thumbnails/image gallery location etc actually. The lists/gallery appearance is determined by habitual HTML techniques
  • <diritem> - sets position and determines appearance of subfolder items in the subfolder list;
  • <fileitem> - sets position and determines appearance of file items of the file list;
  • <pictitem> - the same for thumbnails (for .dir templates only);
  • <mwsbody> - sets the place to insert original content of HTML, HTM, or text files named as HTM(L) (for .file templates only);
%LINK% and %NAME% parameters (if any) of the tags are substituted with actual link and name values of each file, directory and picture respectively.
Template changes reflection is made by (a) template dependent file update (the file modification time changing is enough) and (b) browser refresh. The browser would not be able to re-request the page from the server otherwise and will show locally cached (previous) page.