TclMML

[mml upload document]

Documentation: Uploading Documents

[ Home | Docs | FAQ | Download | CVS | Mailing Lists | Bug Tracker | USPS's MOL Site ]

Syntax

mml upload document ?-flags? ?-switches? document_name

Flags

-only_if_not_found (Optional)

This flag indicates that the document should only be uploaded if an existing document with the same $document_name does not exist.

Switches

-debug filename (Optional)

If specified, the XML generated and sent to the MOL system, as well as the XML reply from the MOL system, will be appended to filename.

-data data (Required Alt.)

Use this switch to provide the $data to be uploaded. This switch is mutually exclusive with -file.

-file filename (Required Alt.)

Use this switch to specify that the contents of filename are to be read & uploaded. This switch is mutually exclusive with -data.

Positional Arguments

document_name

This is an arbitrary text string used to name the document. The MOL system requires document_name to be unique; however, if a duplicate is used, MOL (appears to) append a counter suffix of sorts.

Return Value

If successful the document_id assigned by the MOL system is returned. This is an opaque value used to identify the document in subsequent actions (i.e., document details, delete document, and upload order).

An error will be returned if the document upload was not succesful. Possible causes under which an error could be raised include: transient network outages, MOL processor internal errors, uploading of document-types that the MOL system does not know how to process, etc.

Notes

For a list of supported file formats, consult the USPS's MOL site.