I want to download a file from FTP connection for that I am using NSURL connection.
The connection have username and password.
If I pass the username and password in the url
ftp://user:password@ftp.example.com/foo/bar.zip
than it works fine. but I want to implement the authentication method where I can pass the password in the callback. But I am not receving any callbacks.
Below is the callback that I have implemented but it never gets called
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
Note:- I tried using Apple sample called SimpleFTPSample but it didnt helped.
To receive callbacks, please check both things:
And u must call it from main queue:
Then, u callbacks will be done, u can using authenticate part user name and pass trick can impossible to parse then from code:
But as i know, user and pass will be sent anyway without any protection, so better solution is moving u content to https server. In that case u can be sure that u