multipart/form-data upload via SSL with compact framework

T

Toralf

Hello,
we have a problem with the multipart upload via https. Without a SSL
connection it works fine! The problem appears while writing in the
stream in line "str.Write(test, 0 , test.Length)". The errormessage is
"Ein Blockierungsvorgang wird momentan ausgeführt" it means in
English: A blocking opperation is currently excecuting. Errormessage
number: 10036

Oure code:

....
Dim str_boundary = "---xyz"
Dim url As String = "https://localhost/Upload.jsp"
Try
Dim test As Byte() = Encoding.ASCII.GetBytes(str_boundary + vbCrLf +
"content-disposition: form-data; name=" + Chr(34) + "File1" + Chr(34) +
"; filename=" + Chr(34) + "dateiname" + Chr(34) + vbCrLf +
"Content-Type: text/plain" + vbCrLf + vbCrLf + str_local_fileData +
str_boundary + vbCrLf)
Dim webReq As HttpWebRequest = CType(WebRequest.Create(url),
HttpWebRequest)
webReq.UserAgent = "TestUpload"
webReq.Method = "POST"
webReq.KeepAlive = True
webReq.ContentType = "multipart/form-data; boundary=" + str_boundary
webReq.ContentLength = test.Length
Dim str as Stream = httpWebRequest_global.GetRequestStream
str.Write(test, 0 , test.Length)
str.Close()
Dim res As HttpWebResponse = webReq.GetResponse
...
End Try
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top