hi, ich möchte per httpwebrequest das file "blubb.txt" uploaden, nun was mache ich falsch?
Code:
Imports System.IO
Imports System.Net
Imports System.Text
Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send.Click
Dim verz As String = System.Environment.CurrentDirectory
Const fpath As String = "blubb.txt"
Dim req As HttpWebRequest = CType(WebRequest.Create("http://svrwalk.sv.funpic.de"), HttpWebRequest)
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"
req.Timeout = 12000
Dim post As String = Path.Combine(verz, fpath)
Dim byteArray() As Byte = Encoding.UTF8.GetBytes(post)
req.ContentLength = byteArray.Length
Dim DataStream As Stream = req.GetRequestStream()
DataStream.Write(byteArray, 0, byteArray.Length)
DataStream.Close()
End Sub