WsUploadFileEx
Upload data to a WebService endpoint using a POST request.
Syntax
bool WsUploadFileEx (string url, string filename, string sessionkeys, string method, int timeout)
Parameters
- string url
- Required: the URI of the resource to receive the file. Smart parameters are supported.
- string filename
- Required: the file to send to the source. Smart parameters are supported.
- string sessionkeys
- Optional: comma-separated list of session key names.
- string method
- Optional: the file upload method. By default, POST is used for HTTP and STOR for FTP.
- int timeout
- Optional: the timeout value in milliseconds before abandoning the request. Smart parameters are supported.
Returns:
True, if the action succeeds. Otherwise, False.Level
All levels.Details
Uploads a file to a web service.The timeout value specified for this operation will override any timeout value set elsewhere. The default timeout value is 60000 milliseconds, or one minute. If no method is specified, the default used is POST for HTTP and STOR for FTP.
Example
WsSetHeader("http://server/service","Content-Type","application/json","True")
WsSetHeader("http://server/service","accept","*/*","True")
WsUploadFileEx("http://server/service","C:\Test\myfile.jpg","Set-Cookie","POST","120000")