pp108 : Upload

Upload

This Web service operation is used to upload a file.

SOAP Request

<upload xmlns="http://schemas.cordys.com/1.0/ftp">
    <server>ftpserver</server>
    <user>anonymous</user>
    <password>[email protected]</password>
    <portno>21</portno>
    <synchronous>true</synchronous>
    <notification-subject>FTP</notification-subject>
    <files>
        <file type="ascii">
            <source>C:\remove.log</source>
            <target>\test.info</target>
        </file>
    </files>
</upload>

Request Parameters

Parameter

Description

server

Name of the FTP server to which the file must be uploaded.

user

Name of the FTP user.

password

Password for the FTP server.

portno

The port number used by the FTP server; this tag is optional.

notification-subject

Notification subject on which the user has to subscribe to the Event service, to obtain the status of the request.

files

The files to be uploaded.

file

Details of each file. The type attribute here specifies the type of download (ascii or bin).

data

Contents of the file to be uploaded
By default the value of encode is false, i.e. the data is sent as ASCII text. If encode is set to true, the data is Base64 encoded. This tag is used while uploading a file as part of a SOAP message.

source

The name of the file to be uploaded. This tag is used while uploading a file from a specified source.

target

The path and the name of the file which must be uploaded to the FTP server.

synchronous

Specifies if the response must be intimated to the client. This can hold the following values:

  • true - The process will continue without any interruption and the FTP client would wait for the response.
  • false - The event handler will handle the response.

passive

When this parameter is set to 'true', the passive mode is enabled, where the client initiates both connections to the server. When this is set to 'false', the active mode is enabled, where the client connects from a random unprivileged port.

SOAP Response

<uploadResponse xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <server xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ftpserver</server>
    <user xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">anonymous</user>
    <portno xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">21</portno>
    <notification-subject xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">FTP</notification-subject>
    <files xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <file type="ascii" xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
            <source>C:\remove.log</source>
            <target>\test.info</target>
            <statuscode xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">226</statuscode>
            <status xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">Transfer complete. </status>
        </file>
    </files>
</uploadResponse>

Related reference

Upload
onAfterBrowse
onBeforeUpload
browse Operation
onupload Event