WebDat Landing Page
Even simpler than the Desktop Landing Page, the expweb.php template allows you to hand-off upload and download links to a minimalist Web interface. It allows you to present custom branding and instructions, give new users a chance to download the WebDat client, and limits users to the functionality of the URL.
The template checks whether WebDat is running and offers links to download the client if it is not detected. Note the following requirements:
- A web server supporting PHP 7 or later.
- If the server specifies CORS or CSP policies, it must allow 127.0.0.1:8091.
- Copies of the expweb.php and EXP.js files.
- A Firefox, Chrome, or compatible web browser. Safari is not compatible.
Once WebDat is detected, the user will be offered a button to start the upload or download specified by the URL. For security, WebDat must then prompt to select which files to upload or which folder to receive downloads. The web page will then display progress and results.
It is not necessary for the web server and ExpeDat server to be running on the same machine and they do not need to share any files or folders.
Restrictions
Modern web browsers limit communication between web pages and the host environment. As a result, the WebDat Landing Page has several restrictions compared to the Desktop Landing Page:
- Any server CORS or CSP policies must allow http://127.0.0.1:8091. See the header examples in expweb.php.
- Local anti-virus or firewall software must allow http://127.0.0.1:8091.
- The Web Browser must allow access to http:127.0.0.1:8091. Safari is not compatible, use Firefox or Chrome instead.
- WebDat is not available for mobile. Use the Desktop Landing Page with the iOS ExpeDat Mobile client instead.
- It is not possible for the page to distinguish between security restrictions and WebDat not running.
- WebDat only prompts for file locations. All other information, including credentials, must be provided in the URL or template.
- WebDat does not provide remote file browsing. Use the Desktop Landing Page for users needing to browse remote files and folders.
Thoroughly test your implementation to ensure that server and client security policies will allow WebDat. Because user credentials must be specified in the URL or template, make sure to restrict the ExpeDat user account to only allow desired operations. For example, set GetOnly to ensure only downloads are permitted.
WebDat Landing Page Interface
The screenshot above shows an example of what a user might see after clicking an ExpeDat HTTP link with WebDat already installed. Several elements can be customized by editing a form at the top of the template file. See Installation below for details.
The action button will start the upload or download specified by the URL. For security, WebDat must prompt to select which files to upload or which folder to receive downloads. The web page will then display progress and results. After completion, the user may click the button again to repeat the action, or use a different URL to perform a different action.
If WebDat cannot be detected, either because it is not installed or due to security restrictions, the page above will be displayed. The page will automatically detect when WebDat becomes available.
Installation
The expweb.php and EXP.js files can be found in the "Web" folder of the full ExpeDat distribution package. Copy these files to your web server and place them in a linkable location. Do not place them in a folder you will be sharing via ExpeDat. You can rename expweb.php however you want.
Open this copy of expweb.php in a text editor. All of the settings needed for basic customization are at the top of the file. You must provide links to YOUR copies of WebDat for macOS, Windows x86-64, and Windows ARM64.
You may customize the page appearance by setting your own descriptions and links. Any fields left blank will receive default text referencing Data Expedition, Inc. All of the information about the upload or download should be provided in the URL which you will send to end-users. But you may shorten the URLs by filling in some default information.
$Page_Title = "ACME File Submission"; $Page_Message = "Use this form to upload your files to our ExpeDat server."; $Your_Logo = "https://acme.example.com/graphics/acmelogo.png";
Creating Landing Page Links
To create a WebDat landing page link, first create an expedat:// URL and then append it to the URL of the expweb.php page with a question mark in between. For example:
https://www.example.com/expweb.php?expedat://exp01.example.com:8080/test1mb.dat?u=web&p=demo114
Note that this URL contains two question marks. The first question mark separates the "https://" server and path from the "expedat://" server and path. The second question mark separates any options you are specifying such as a username or encryption.
You can make your URL much shorter by leaving out portions which refer to default values. For example, if you define the $ExpeDat_Server value as shown below, you can leave out the "expedat://server" portion:
https://www.example.com/expweb.php?test1mb.dat?u=web&p=demo114
You can make it shorter still by presetting other values in the expweb.php file:
$ExpeDat_Server = "exp01.example.com"; $ExpeDat_Username = "web"; $ExpeDat_Password = "demo114";
With these settings, a download link could be reduced to this:
https://www.example.com/expweb.php?test1mb.dat
The default action when a file is specified is to download that file. To upload a file or download a folder, use the "a=" action to specify:
a=s | Send a file or folder. |
a=f | Get a folder. |
a=g | Get a file. |
For example, to prompt a user to upload a file, using otherwise default targets, it might look like this:
https://www.example.com/expweb.php??a=s
Notice that the link above contains two question marks. The first specifies that we are using the default server and path, while the second marks the beginning of options. In this case, the option is a "Send" action. See the expedat:// URLs page for more details about URL parameters. Only uploads and downloads are supported by the expweb.php landing page.
Configuration
The "$ExpeDat_" settings in expweb.php act as defaults allowing you to create shorter links. They can be overridden by adding the appropriate information back to the link. The other settings allow you to customize the page itself.
Link Defaults | |
$ExpeDat_Server | The DNS name or IP address of the default ExpeDat serverand its port number. For example: "exp01.example.com:8080". |
$ExpeDat_Username | The default ExpeDat username to use if none is given in the User Link. If no username is provided at all, the user will be prompted to enter a username and password when they click the ExpeDat link. |
$ExpeDat_Password | The default ExpeDat password to use if none is given in the User Link. If no password is provided at all, the user will be prompted to enter a username and password when they click the ExpeDat link. A password given here will not be immediately displayed to the user, but it will appear in the target of the ExepDat link. |
$ExpeDat_Path | An additional path which will be prepended to all file names passed to ExpeDat. This is useful if target files will be in a sub-folder of the ExpeDat Home Directory. Always use forward slash '/' to delimit remote paths. |
$ExpeDat_Handler | Set to a server Object Handler to request that transactions be routed to that handler. If left blank, no handler will be used regardless of ExpeDat Desktop's current settings. |
$ExpeDat_Upload | Set this to any non-empty string to make uploading files the default action. Uploading will cause the ExpeDat client to prompt the user to select files and then upload those files to the ExpeDat server at the pathname given in the URL. |
Page Customization | |
$Page_Title | This text will be inserted as the HTML <TITLE></TITLE> tag of the page and the headline beneath the menu bar. Default: "WebDat Landing Page" |
$Page_Message | This text will be inserted below the headline and above the file browser. Default: "This page was generated by a customizable PHP script." |
$Your_Logo | This image URL will be placed at the top left of the page. Default: The Data Expedition, Inc. logo. |
$Your_Home | The URL to be followed when "Home" is clicked in the menu. Default: https://www.DataExpedition.com/expedat/ |
$Your_Support | The URL to be followed when "Support" is clicked in the menu. Default: https://www.DataExpedition.com/expedat/Docs/ |
$Your_Email | An email address (or any other text) to be displayed in the lower left of the page. Optional |
$Your_Phone | A phone number (or any other text) to be displayed in the lower right of the page. Optional |
$Download_Mac | A link to your licensed copy of the WebDat installer for macOS. Default: https://www.dataexpedition.com/expedat/trial.html |
$Download_Winx86 | A link to your licensed copy of the WebDat installer for Windows x86-64. Default: https://www.dataexpedition.com/expedat/trial.html |
$Download_Win | A link to your licensed copy of the WebDat installer for Windows ARM64. Default: https://www.dataexpedition.com/expedat/trial.html |
You may perform additional customization by editing the remaining expweb.php source code, however such alterations are not supported.