Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLite - Database Management and Reference » UltraLite as a MobiLink Client » UltraLite clients


Using MobiLink file transfers

All UltraLite libraries support the ability to transfer files with the MobiLink server, except M-Business Anywhere. M-Business Anywhere does not need this functionality because it has its own mechanism for file deployments or transfers (called channel synchronization).

For all other APIs, use the MobiLink file transfer mechanism when:

  • You have multiple files that you need to deploy to multiple devices, particularly when corporate firewalls are used as a security measure. Because MobiLink is already configured to handle synchronization through these firewalls, the MLFileTransfer mechanism makes device provisioning for upgrades and other types of file transfers very convenient.

  • You have files that you want to target to a specific MobiLink user ID. This requires that you create one or more user-specific directories on the MobiLink server for each user ID you require. Otherwise, if you only have a single version of the file, you can use a default directory.

How file transfers work

You can employ one of two MobiLink-initiated file transfer mechanisms to download files to a device: run the mlfiletransfer utility for desktop transfers, or call the appropriate function for the API you are using to code your UltraLite application. Both approaches require that you:

  1. Describe the transfer destination.

    Whether you use the mlfiletransfer utility from the desktop, or whether you use the function appropriate to your API, you must set the local path and file name of the file on the target device or desktop computer. If none are supplied in the application or by the end user, then the source file name is assumed and the file is stored in the current directory.

    The destination directory of the target can vary depending on the device's operating system:

    • On Palm OS, if your destination is an external storage media, you must prefix the destination of the local path with vfs:.

      If the destination is NULL, mlfiletransfer assumes that the file you need to download is a Palm record database (a *.pdb file) to the device's record store.

      The file name must follow file name conventions for Palm OS. See Palm OS.

    • On Windows Mobile, if the destination is NULL, the file is stored in the root directory ( \ ).

      The file name must follow file name conventions for Windows Mobile. See Windows Mobile.

    • On the desktop, if the destination is NULL, the file is stored in the current directory.

      The file name must follow file name conventions for the desktop system. See Windows desktop.

  2. Set the user credentials that allow the user to be identified and the correct file(s) to be downloaded.

    This user name and password are separate from any database user ID and password, and serve to identify and authenticate the application to the MobiLink server.

  3. Set the stream type you want to use, and define the parameters for the stream you require. These are the same parameters supported by UltraLite for MobiLink synchronization. See UltraLite synchronization parameters and network protocol options.

    Most synchronization streams require parameters to identify the MobiLink server address and control other behavior. If you set the stream type to a value that is invalid for the platform, the stream type is set to TCP/IP.

  4. Describe the required behavior for the transfer mechanism.

    For example, you can set properties that allow this mechanism to force a download even when the file already exists on the target and has not changed, or that allow partial downloads to be resumed. You can also set whether you want the download progress to be monitored and reported upon.

  5. Ensure the MobiLink server is running and has been started with the -ftr option.

  6. Start the transfer, and, if applicable, monitor the download progress.

    By displaying the download progress, the user can cancel and resume the download at a later time.

See also