You are here: Reference Manual > FME Server Services > Utility Services > Data Upload Service

Data Upload Service

Users can upload source data or other file-based resources for FME Server Workspaces.

In the FME Server Web User Interface, File Upload is available on the Configure page for any workspace with a published parameter that represents a file used by the workspace. For more information, see Uploading Data Files.

Note: When working with .zip files, we recommend using modern zip utilities that support Unicode file names. If file names are not in Unicode, you can specify the DEFAULT_ZIP_CODEPAGE web application property.

Once data is uploaded, users can select the uploaded data for the workspace to use. Uploaded files are stored in a private location accessible to FME Server but not the user.

Shelf Life of Uploaded Files

By default, files are deleted 30 minutes after they are uploaded. You can change this availability period by manually editing the Data Upload web.xml file.

File location: <FMEServerDir>\Utilities\tomcat\webapps\fmedataupload\WEB-INF\web.xml

Change:

<session-timeout>

30

</session-timeout>

For example, to change the availability of uploaded files to 90 minutes:

<session-timeout>

90

</session-timeout>

Request Elements

Supported Request Methods

This section describes the various methods available for interacting with the Data Upload service. The methods supported for sending files are PUT and POST. The HTTP GET method is supported for browsing files that are already uploaded.

Remember that only volatile storage is supported and that all requests must be associated with an FME Server workspace.

Request

Request Description

HTTP Method

Target URI

Upload a single file

You can upload a file using the HTTP PUT method.

PUT

http://host[:port]/fmedataupload/<repository>/<workspace>/<filename>

Upload a single file or multiple files

You can upload a single file or multiple files using a simple form submission that uses the HTTP POST

POST

http://host[:port]/fmedataupload/<repository>/<workspace>

Browse Uploaded Files

You can acquire a listing of all uploaded files for a session by making a GET request to either the same URI used to upload files originally, or, in the case of archives, append to this an archive file and/or a file path within the archive for a listing of files there.

You can use the optional path component at the end to show the contents of a sub-folder within an archive file. To report just the root contents of the archive file, omit the optional path part.

For example, the request URI /fmedataupload/Samples/austinWFS.fmw/myfile.zip/pictures/
shows a listing of all files contained within the pictures sub-folder of the archive file named myfile.zip.

GET

http://host[:port]/fmedataupload/<repository>/<workspace>/<archive file name>/[<filename or path within archive>]

Service Specific Request Parameters

Name

Value

Description

opt_fullpath

true | false
Default: false

When enabled the service response includes the physical or absolute path for each file that the FME Engine can use.

opt_extractarchive

This parameter is not available in HTTP GET because extracting archives is an operation and not a state flag.

true | false
Default: false

When enabled the service extracts uploaded zip files and returns the file contents inside of zip files.
In this case, the file names are logical paths relative to the zip files' container.
For example, a SHAPE file named roads.shp inside of a roads.zip file is returned as roads.zip/roads.shp.

opt_responseformat

xml | json
Default: xml

Defines the language of the response. The text must be all lowercase.

opt_pathlevel

-1 | 0 | n
Default: 1

This parameter indicates how many levels of recursion deep to show file and folder information.
A value of-1 denotes complete recursion as deep as there is.
A value of 0 means do not return any information at all.
Any other positive number denotes the number of levels of recursion. For example, a value of 1 would request only the files in the requested path; that is, only children of the requested path and not descendants.

Preserving Session State

Java EE lets you explicitly specify the session ID of a request URL. This specification ensures that the correct session state is preserved for a session when cookies do not work properly or are not available. Simply append the following parameter immediately following the path part of the request URI:

;jsessionid=<session id>

Response Elements

Element

Child Elements

Value

Description

statusInfo

status

success | failure

The service status

file, folder, archive

name

string

The name of the file that was uploaded

size

long integer

The size in bytes of the file uploaded.The size element does not apply to folders and is absent beneath folder elements.

path

string

The absolute or physical path of the file (which is used by an FME Engine)

session

none

string

A session identifier that is always included in each data upload response as an HTTP cookie as well as in the body of the response.

Note: There will always be a folder node with an empty name attribute. This folder node is the placeholder for the directory that contains the uploaded files for the scope defined by the current user session, workspace name and repository name. This placeholder can be used later when requesting full paths to retrieve the full path to the parent directory for all uploaded files in your scope.

If opt_extractarchive is set to false, the following scenarios results:

  • If the requested path inspects the contents of a zip or archive file, then an error response results.
  • If the requested path is valid, but the opt_pathlevel is 2 or higher, then a path level of 1 is implied.