Advanced

Advanced topics

Servlet: LoadingZoneUpload

com.pageseeder.load.servlets.LoadingZoneUpload

Description

Uploads one or more files to the loading zone and can be accessed via the following URL:

/ps/servlet/upload

The loading zone is a temporary container for files on the server before they are loaded into PageSeeder. There is a separate loading zone for each member on each group. Within a group a member can have multiple loading zones by specifying a unique uploadid or xlinkid for each one. An xlinkid is used to upload attachments to a draft comment before it is submitted (the xlinkid is the same as the comment ID).

After files have been uploaded the various load services can be used to modify, unzip them and start loading them into PageSeeder or the autoload=true parameter can be used to load them immediately using a default configuration.

Note

If updating code to use this servlet instead of the deprecated com.pageseeder.upload.servlets.UploadServlet note that title, description, labels and docid parameters are no longer supported by POST (use PUT instead). Also the returned XML is quite different.

Returned XML

If autoload=true and one file uploaded:

 <upload member="[member ID]" [uploadid="[uploadid]" status="[failed|completed]"]
     max-workflow-notifications="20">
   <message>[explanation or error]<message>
   <uri id="[uri id]" ... />
 </upload>

If autoload=true and more than one file uploaded (HTTP 202 returned):

 <upload member="[member ID]" [uploadid="[uploadid]"] max-workflow-notifications="20">
   <thread id="[thread ID]" ...>
     [thread XML]
   <thread>
 </upload>

Otherwise the following:

 <upload member="[member ID]" [uploadid="[uploadid]"] max-workflow-notifications="20">
   <file name="[filename]" path="[path]" type="file" ... />
   ...
 </upload>

HTTP Method: POST

Uploads multiple files to the loading zone using multipart file upload.

HTTP Parameters

groupThe group the file should be uploaded into (required if not multipart and if no X-Group-Name header)conditionalstring
filenameThe name of the file to upload (required if not multipart and no X-File-Name header)conditionalstring
uploadidAn ID to uniquely identify this upload (overrides xlinkid)nostring
xlinkidA comment ID used to build an upload ID (for comment attachments' loading zone - no autoload).nostring
memberID or username of a member to upload on behalf of (for admins only)nostring
overwriteWhether the uploaded file should overwrite an existing file (in loading zone and PageSeeder)nobooleanfalse
autoloadWhether the file should be loaded into PageSeeder after the uploadnobooleanfalse
folderThe folder the files should be uploaded into (relative to the root of the group - used with autoload=true, ignored if url is specified)nostring
urlA URL pointing to the folder the files should be uploaded into (used with autoload=true)nourl
overwrite-propertiesWhether the uploaded file should overwrite existing URI properties (used with autoload=true)nobooleanfalse
file-[n]The nth file to upload as a multipart parameter (required)nostring
folder-[n]The folder to upload the nth file to as a multipart parameter (relative to loading zone root)nostring

HTTP Method: PUT

Uploads a single file to the loading zone using put.

HTTP Parameters

groupThe group the file should be uploaded intoyesstring
filenameThe name of the file to upload (required if no X-File-Name header)conditionalstring
uploadidAn ID to uniquely identify this upload (overrides xlinkid)nostring
xlinkidA comment ID used to build an upload ID (for comment attachments' loading zone - no autoload).nostring
memberID or username of a member to upload on behalf of (for admins only)nostring
overwriteWhether the uploaded file should overwrite an existing file (in loading zone and PageSeeder)nobooleanfalse
autoloadWhether the file should be loaded into PageSeeder after the uploadnobooleanfalse
folderThe folder the file should be uploaded into (relative to the root of the group - used with autoload=true, ignored if url is specified)nostring
urlA URL pointing to the folder the file should be uploaded into (used with autoload=true)nourl
overwrite-propertiesWhether the uploaded file should overwrite existing URI properties (used with autoload=true)nobooleanfalse
titleThe title of the file contained in the upload (used with autoload=true)nostring
descriptionThe description of the file contained in the upload (used with autoload=true)nostring
labelsA comma-separated list of labels to attach to the file contained in the upload (used with autoload=true)nostring
docidThe document ID of the file contained in the upload (used with autoload=true)nostring

Created on , last edited on