Я не проверял, будет ли это работать, но я бы попробовал что-то вроде:
' post request with some parameters inside query string
uriPath = String.Format("{0}{1}?func=xxx&uid={2}", url, fileName, id)
reqUri = New Uri(uriPath)
webReq = CType(WebRequest.Create(reqUri), HttpWebRequest)
webReq.Method = "Post"
' webReq.Timeout = 10000
webReq.KeepAlive = False
webReq.ContentType = "application/x-www-form-urlencoded"
' HERE is a place to attach your files
' try to run it at loop for each file
form = "name=" & fileName
webReq.ContentLength = form.Length
Dim sw As New StreamWriter(webReq.GetRequestStream, System.Text.Encoding.ASCII)
sw.Write(form)
' here write/send the file content
sw.Flush()
sw.Close()
sw.Dispose()
' reading response
Using res As WebResponse = webReq.GetResponse
Dim st As Stream = res.GetResponseStream()
Dim rd As New StreamReader(st)
status = rd.ReadLine()
Если я хорошо помню, POST-запрос типа application/x-www-form-urlencoded
отправляется в виде:
--- params separator
name=fileName
file content
--- params separator
name=fileName1
file1 content