Uploadfile with credential

  • Thread starter Flavio Software House
  • Start date
F

Flavio Software House

Hi
I need to send files to a web site
but only a special user can send this files..

i try this but cause i have a formsauthentication don't go !!!
please any help

Dim w As New System.Net.WebClient
w.Credentials = New System.Net.NetworkCredential("myusername",
"mypassword")
w.UploadFile("http://localhost:2386/cdaweb/System/ServerList.aspx?storeserverlist",
"c:\additions.log")

thanks in advance
flavio
 
D

Dominick Baier [DevelopMentor]

Hello Flavio,

FormsAuth and what are you trying to do will not work, because you don't
have an authentication cookie.

you have to enabled PUT on this directory in IIS
enable integrated or basic auth for the directory
exclude the directory from formsauth

create a windows user
configure ACLs for that single user in the Upload directory

WebClient has a Credentials property. Set this to default credentials (if
integrated auth is applicable) otherwise use Basic Authentication by providing
username/password in the Credentials (be aware that these will be transmitted
in clear text - use SSL to avoid this).
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top