File upload assitance requested

B

Big Tony

I'm going crazy trying to do something I think should be simple.

Task: Windows service that will post a file to a WebServer automatically.

I have created a form on the remote site. I can use IE and post to it.
When I try to use System.Net.Webclient to post to the form, it does not work.
No error is returned, but the file does not upload.


Here is the code that is used to post.
Dim Client As New WebClient
Dim UriString As String = "http://10.80.1.169/vbnetupload/webform1.aspx"
Dim filename As String = "c:\new.txt"
Dim responseArray As Byte() = Client.UploadFile(UriString, "POST", filename)

Can anyone clue me in on what I'm doing wrong here?
 
M

MS News \(MS ILM\)

Big Tony said:
I'm going crazy trying to do something I think should be simple.

Task: Windows service that will post a file to a WebServer automatically.

I have created a form on the remote site. I can use IE and post to it.
When I try to use System.Net.Webclient to post to the form, it does not work.
No error is returned, but the file does not upload.


Here is the code that is used to post.
Dim Client As New WebClient
Dim UriString As String = "http://10.80.1.169/vbnetupload/webform1.aspx"
Dim filename As String = "c:\new.txt"
Dim responseArray As Byte() = Client.UploadFile(UriString, "POST", filename)

Can anyone clue me in on what I'm doing wrong here?
 
N

Natty Gur

Hi,

Did you try to catch Exceptions?

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
M

Michal A. Valasek

| Is it possible to upload the file without user interaction to a form post
the form?

No, it is not. If it *would* be possible, it would be a big security flaw.
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top