File upload assitance requested

  • Thread starter Thread starter Big Tony
  • Start date Start date
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?
 
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?
 
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
 
| 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.
 
Back
Top