指定したスキームとホスト名およびパス名を持つリモートサーバへバイト配列のデータをアップロードします。
[Visual Basic]
Public Function HttpUploadByteArrayToFile(ByVal scheme As String, ByVal remoteHost As String, _
ByVal remotePath As String, ByVal ByVal data As Byte()) As Boolean
[C#]
public bool HttpUploadByteArrayToFile(string scheme, string remoteHost, string remotePath,
byte[] data);

パラメータ

scheme
インターネット アクセス プロトコル("http" or "https")
remoteHost
DNS スタイルのドメイン名、または IP アドレス
remotePath
リモート パスの名称
data
バイト配列のデータ

戻り値

成功の場合は true 、失敗の場合は false を返します。

解説

HTTP , HTTPS プロトコルの場合に有効です。

使用例

[Visual Basic.NET]
Dim Ret As Boolean
'ユーザ名とパスワード
ImageKit1.File.HttpCredentials = New NetworkCredential("user", "password")
'バイト配列のアップロード、dataはあらかじめ設定しておくこと
'POSTの場合
ImageKit1.File.HttpMethod = "POST"
ImageKit1.File.HttpHeaders.Set("Content-Disposition", "form-data; name=""file""; filename=""test.jpg""")
Ret = ImageKit1.File.HttpUploadByteArrayToFile("http", "www.newtone.co.jp", "test/upload.php", data)
'PUTの場合
'ImageKit1.File.HttpMethod = "PUT"
'Ret = ImageKit1.File.HttpUploadByteArrayToFile("http", "www.newtone.co.jp", "test/test.jpg", data)

[Visual C#.NET]
bool Ret;
//ユーザ名とパスワード
ImageKit1.File.HttpCredentials = new NetworkCredential("user", "password");
//バイト配列のアップロード、dataはあらかじめ設定しておくこと
//POSTの場合
ImageKit1.File.HttpMethod = "POST";
ImageKit1.File.HttpHeaders.Set("Content-Disposition", "form-data; name=\"file\"; filename=\"test.jpg\"");
Ret = ImageKit1.File.HttpUploadByteArrayToFile("http", "www.newtone.co.jp", "test/upload.php", data);
//PUTの場合
//ImageKit1.File.HttpMethod = "PUT";
//Ret = ImageKit1.File.HttpUploadByteArrayToFile("http", "www.newtone.co.jp", "test/test.jpg", data);

参照

ImageKit.File メンバ | Newtone.ImageKit.WPF.ImageKit