Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Having a problem with sending a file via HTTP post in vb.net. I am trying to mimic the following HTML so the vb.net does the same thing.

<form enctype="multipart/form-data" method="post" action="/cgi-bin/upload.cgi">
File to Upload:
<input type="file" name="filename"/>
<input type="submit" value="Upload" name="Submit"/>
</form>

Hope someone can help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
288 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think what you are asking for is the ability to post a file to a web server cgi script from a VB.Net Winforms App.

If this is so this should work for you

Using wc As New System.Net.WebClient()
    wc.UploadFile("http://yourserver/cgi-bin/upload.cgi", "c:est.bin")
End Using

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...