views:

66

answers:

1

Hi, HttpPostRequest with Files only in VB2008 is easy:

    Using wc As New System.Net.WebClient()
        wc.UploadFile("http://server.de/exemple.php", "c:\test.png")
    End Using

But I want POST Text + Files in one POST (username, password, file). But, how to?

A: 

This is not possible with WebClient. You will need to use HttpWebRequest and manually format the request according to RFC 1867.

Darin Dimitrov
Do you have an example for that? I found an exemple for text only, but not with files.
tobiasre
http://stackoverflow.com/questions/566462/upload-files-with-httpwebrequest-multipart-form-data
Darin Dimitrov
A exemple in VB would be better, thanks.
tobiasre