getUploadURL
Synopsis
string getUploadURL(SessionId sessionId,
SessionCacheFileType fileType,
string* suffix,
ArchiveFileType? archiveType)
throws SessionServiceFault;
enum ArchiveFileType {
UnixAR
}
See also: SessionId, SessionCacheFileType, SessionServiceFault
This operation may be used to get an URL that can be used with HTTP PUT to upload a file into the cache directory of the current session. Once the file has been uploaded, the URL can be used with other operations (loadSession, paste of basket web service) for further processing of the file.
The fileType parameter must be passed to the operation and must be a valid session cache file type (as defined by the enum type). The suffix parameter is optional. If it is missing (or null in many language bindings), the operation uses the default suffix for the file type (‘.obk’ for ‘Project’ and ‘.obx’ for ‘CutBuffer’). Otherwise, if the suffix is not empty and does not start with a period (‘.’), a period is prepended to the suffix. The suffix is then used as the file name suffix of the path component of the returned URL.
To upload an archive file and make its members accessible through HTTP URLs, a client should pass Import as fileType and UnixAR as archiveType. The suffix should be .ar (or ar), or should be left empty, in which case it defaults to .ar.
The returned URL is intended to be used with a subsequent HTTP PUT request. While processing the PUT request, the HTTP server mounts the uploaded archive file after writing the request body (the archive file) to the file system, but before sending the response message.
The client can subsequently append the archive member name to the archive URL, separated with !/ from the archive file name. Such archive member URLs can then be used in HTTP GET requests and as parameters of operations that import resources (like images) into a project, paste OBX files, or load OBK files.
Archive files must use the BSD (preferred) or SVR4/GNU format (see ar(5)), or the Microsoft .lib format. Symbol files, if present, are ignored.
File names in archive files must not contain forward slashes. The ar(1) tool always stores just the file name, even if the file is specified on the command line using a path name. Microsoft’s lib.exe, on the other hand, appears to store path names as specified on the command line, using backslash as name separator. These backslashes are treated by the HTTP server’s archive file reader as ordinary file name characters.
The HTTP upload endpoint supports gzip and deflate in Content-Encoding for PUT requests. Unsupported encodings result in HTTP 415 with an Accept-Encoding response header. OPTIONS on a resource returns Allow and, if PUT is allowed, Accept-Encoding; the special OPTIONS target * is not supported. HTTP 405 responses list the allowed methods in Allow.