Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Uploadfile with credential

Reply
Thread Tools

Uploadfile with credential

 
 
Flavio Software House
Guest
Posts: n/a
 
      06-08-2005
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


 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      06-08-2005
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).

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> 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?stor
> eserverlist",
> "c:\additions.log")
> thanks in advance
> flavio




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebClient.UploadFile adds stuff to the file. UJ ASP .Net 2 09-16-2006 08:16 AM
File Upload issues with WebClient.UploadFile Phillip N Rounds ASP .Net 1 02-02-2006 09:13 PM
UploadFile Ching-Lung ASP .Net 5 11-23-2003 12:45 PM
Problems with WebClient.UploadFile David W ASP .Net 0 10-29-2003 04:21 PM
webclient.uploadfile application question belfast neil ASP .Net 0 07-28-2003 01:44 PM



Advertisments