Skip to main content

ftp.put(URL, body)

Creates a new FTP upload request object

Availability

Agent

Parameters

Name Type Description
URL String The URL to which the body will be uploaded
body Blob or String The data to upload

Returns

An httprequest object

Description

This method returns an httprequest object primed to make an FTP PUT request. The request isn’t issued until either httprequest.sendsync() or httprequest.sendasync() is called on the returned httprequest object.

The contents of the body parameters will be uploaded and stored with the name specified in the URL.

The URL may be in any form suitable for FTP, such as "ftp://host:port/path" for anonymous retrieval or "ftp://user:password@host:port/path" where a username and password are required. The URL must start with "ftp:" — ie. it must include the colon. FTPS is not supported.

See either of the ‘send’ methods listed above for information on status code values indicating success or failure (eg. login denied).

Example Code

The following agent code snippet uses ftp.put() to set up a request to post data converted to a CSV spreadsheet file to an FTP server.