[Visual Basic] Public Function HttpUploadFile(ByVal remoteAddress As System.Uri, _ ByVal localFileName As String) As Boolean
[C#] public bool HttpUploadFile(System.Uri remoteAddress, string localFileName);
パラメータ
- remoteAddress
- アップロード元の URI
- localFileName
- ローカル ファイルの名称
戻り値
成功の場合は true 、失敗の場合は false を返します。
解説
HTTP , HTTPS プロトコルの場合に有効です。
使用例
[Visual Basic.NET]
Dim Ret As Boolean
'ユーザ名とパスワード
ImageKit.File.HttpCredentials = New NetworkCredential("user", "password")
'ファイルのアップロード
'POSTの場合
ImageKit.File.HttpMethod = "POST"
Ret = ImageKit.File.HttpUploadFile(New Uri("http://www.newtone.co.jp/test/upload.php"), "c:\test\test.jpg")
'PUTの場合
'ImageKit.File.HttpMethod = "PUT"
'Ret = ImageKit.File.HttpUploadFile(New Uri("http://www.newtone.co.jp/test/test.jpg"), "c:\test\test.jpg")
[Visual C#.NET]
bool Ret;
//ユーザ名とパスワード
ImageKit.File.HttpCredentials = new NetworkCredential("user", "password");
//ファイルのアップロード
//POSTの場合
ImageKit.File.HttpMethod = "POST";
Ret = ImageKit.File.HttpUploadFile(new Uri("http://www.newtone.co.jp/test/upload.php"), @"c:\test\test.jpg");
//PUTの場合
//ImageKit.File.HttpMethod = "PUT";
//Ret = ImageKit.File.HttpUploadFile(new Uri("http://www.newtone.co.jp/test/test.jpg"), @"c:\test\test.jpg");
参照
ImageKit.File メンバ | Newtone.ImageKit.Win.ImageKit