Uploading to remote server

G

Giulio Simeone

Browsing in the web I find a lot of articles that argue: "With ASP.NET
2.0. uploading files is pretty easy!". I spent on that problem last
three days but didn't found my way through it.

I have to develop a web page that uploads files from my computer to a
remote server. I tried to do it in many different ways, the last one
is:

Dim c,s As String
Dim v() As String
Dim sql As New StringBuilder
c = fileToUpload.PostedFile.FileName
ReDim Preserve v(10)
v = c.Split("\")
s = v(UBound(v))

' c is the entire path, s is only the filename, ex. frog.jpg

Label1.Text = c
Dim up = New System.Net.WebClient
up.Credentials = New Net.NetworkCredential("......",
"........")
up.UploadFile("http://www.spaziomio.net/public/" & s, s)

But doesn't work, it returns me a WebException.

Can you tell me a simple way to upload files from my computer to a
remote server?

Thanks a lot, excuse me for my approximate English!!
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top