upload

Upload file from local files system using the HTTP or FTP protocol.

void
upload
(
Conn = AutoProtocol
)
(,
const(char)[] url
,
Conn conn = Conn()
)
if (
isCurlConn!Conn
)

Parameters

loadFromPath string

path load data from local disk.

url const(char)[]

resource to upload to

conn Conn

connection to use e.g. FTP or HTTP. The default AutoProtocol will guess connection type and create a new instance for this call only.

Examples

import std.net.curl;
upload("/tmp/downloaded-ftp-file", "ftp.digitalmars.com/sieve.ds");
upload("/tmp/downloaded-http-file", "https://httpbin.org/post");

Meta