C# - get JSESSIONID site ftp error 401

Asked

Viewed 39 times

0

I can’t get JSESSIONID to download a file from an ftp. I need it because if I put JSESSIONID fixed the file low, otherwise it gives error 401 unauthorized. However this id changes.

WebRequest request = WebRequest.Create(url);

request.Credentials = new NetworkCredential("user", "senha");

request.Method = WebRequestMethods.Ftp.DownloadFile;

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

JSESSION is only filled in when it gives the error, when I try something like "Getcookies()" or "Httpcontext.Current.Request.Cookies" comes as null. I have tried with WEBCLIENT too.

  • I may be very mistaken but I’ve never seen an ftp need jsessionid, but anyway, for you to achieve this value you need to create a webresponse from your request, in it will possibly be jsession among cookies

  • i do there in request.Getresponse() but not authorized error 401

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.