Skip to main content

TURL_Put (function reference)

By October 1, 2021October 13th, 2021Online Help, Troi URL plug-in
Troi URL Plug-in for FileMaker Pro

TURL_Put

Sends data to the server or transfers a file to the server, using the PUT method.

SyntaxFunction badge

TURL_Put( switches ; theURL ; theData )

Parameters

switches this determines the behaviour of the plug-in
theURL the url of the server
theData the data to be sent with the PUT method. This can also be a file or image in a container field

Switches

Switches can be one or more of these:

-TimeoutTicks=x specify the connect timeout time in x ticks (1/60th of a second)
-ReturnHeader include the header in the returned text (at the beginning)
-ReturnDataAfterError return the error code followed by the data
-Portnumber=y specify the port number to use
-DontAutoRedirect the plug-in will not go to a redirected page but return the original page
-AllowAnyRootCertificate (for HTTPS) allow root certificates from unrecognized certification authorities. Note that this is less secure
-AlwaysSendUserPassword will directly send the username + password, even when this might not be necessary
-DontTryWithUserPassword don’t send username + password when the web server requests authorization
-NoDialog (obsolete) don’t display a progress dialog

Returned Result

Data type returned

Text

Result

If successful it returns the data of the URL. If unsuccessful it returns an error code starting with $$ and the error code. Returned error codes can be:

$$-1 user cancelled
$$-4230 the connection timed out
$$-3242 this protocol is not supported (use only http and https)
$$-30776 authentication error, you need to supply a correct user name and password
$$-92 servername part of the url is too long
$$-2110 path part of the url is too long

Other errors may be returned, specifically errors in the range 300 to 599, which are HTTP Status Codes.

Originated in

Troi URL Plug-in 3.0

Compatibility

FileMaker Pro 16 to 19

Considerations

Not every web server supports the PUT method.
Note that theData is UTF8 Encoded by default.
Secure connections (HTTPS) using SSL are also supported.
If you don’t specify a timeout, a default timeout of 15 seconds is used.

The length of the URL is limited, by both the plug-in and receiving web servers. A lot of web servers don’t support URLs longer than 2048 characters. Note that the plug-in has higher limits of 32867 characters for the URL.

Note that starting with v6.0 the plug-in no longer shows a progress dialog on nacOS.

Example

TURL_Put ( "-Unused" ; "http://www.example.com/data/user123/mydata.txt" ; "color=blue" )

This will send the data “color=blue” to be put at the location /data/user123/mydata.txt on the web server.

Example 2

We assume that in your FileMaker file the following fields are defined:

MyContainer         		Container
ImageName         		Text

The field MyContainer can contain a file or an image. ImageName should contain the name of the image, for example “img123.jpg”.

Add the following script steps:

Set Variable [ $thebaseURL ; "http://www.photos.com/images/" ]
Set Field [ resultText ; TURL_Put ( "-noDialog" ; $thebaseURL & ImageName ; MyContainer ) ]

This will transfer the imagefile in the container to the web server, to be put in the specified location on the web server: “http://www.photos.com/images/img123.jpg”. Note that web servers might not support the PUT method or refuse this PUT request.

Related functionsFunction badge

TURL_Delete
TURL_Get
TURL_Post
TURL_SetCookies
TURL_SetProxy

Related script stepScript step badge

Put URL

Related topics

Troi URL Plug-in online help (overview)


Online Help Page for Troi URL Plug-in for 16 to 19 –> TURL_Put (urlp4418) 2021-1013 16:30:43