i m trying to download mp3 file from server but i m not getting any data
i m getting error as
Error {
NSLocalizedDescription = "bad URL";
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork Code=-1000 UserInfo=0x1183ac0 "bad URL";
}
here is my code----
i need to store the data received from server.i cn't figure where i m missing&if i provided any path with .wma file or anything else it gets downloaded
i m getting error as
Error {
NSLocalizedDescription = "bad URL";
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork Code=-1000 UserInfo=0x1183ac0 "bad URL";
}
here is my code----
Code:
sender=@"http://sound13.mp3pk.com/indian/7days/7days01(www.songs.pk).mp3";
NSMutableURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:sender]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLResponse *res=NULL;
NSError *error=NULL;
NSData *data=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&res error:&error];
NSLog(@"download data---%@",[res URL]);
i need to store the data received from server.i cn't figure where i m missing&if i provided any path with .wma file or anything else it gets downloaded