user959631
user959631

Reputation: 992

Uploading files from .exe to server

I wanted to know how I would be able to upload files to my server from my WinForms .exe application. I tried: My.Computer.Network.UploadFile(myFile, myServer) but I get this error 'The remote server returned an error: (404) Not Found.' Anyone know another way of uploading files to my server from a .exe? Thanks.

I'm using VB and .Net Framework 4

Upvotes: 0

Views: 1309

Answers (1)

agent-j
agent-j

Reputation: 27943

Here is another way, but it sounds like you are uploading to the wrong page (HTTP error = 404). Check your URL.

Dim fileName As String = AskUserForFileName()
Dim web As New WebClient()
web.UploadFile(uriString, fileName)

Upvotes: 1

Related Questions