Re: Issue with the downloading url

2008-11-07 Thread Jean-Daniel Dupas
This is a specific shoutcast error. Probably an anti-ripper hack. ( http://all-streaming-media.com/streaming-media-faq/faq-SHOUTcast-ripper.htm ). I found it was the user-agent by comparing the request send by Safari (that works) and the one send by my test application (using Wireshark to sni

Re: Issue with the downloading url

2008-11-07 Thread Jean-Daniel Dupas
Check the server response. NSError *error; NSHTTPURLResponse *response = nil; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://yp.shoutcast.com/sbin/tunein-station.pls? id=9907"]]; NSData *data

Re: Issue with the downloading url

2008-11-07 Thread Arnab Ganguly
[data writeToFile:@"/tmp/station.pls" atomically:YES]; ->Works perfectly when I download a html file for example I change the code to [data writeToFile:@"/tmp/station.html" atomically:YES] Issue I get is NSError *error; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"

Re: Issue with the downloading url

2008-11-07 Thread Arnab Ganguly
Hi Al, Thanks for all help but unfortunately the problem still persists.With the below code the data is not null but when I write to a file I don't get anything. I have used the following for writing [data writeToFile:@"/tmp/station.pls" atomically:YES]; but the file size remains zero. Also I tried

Re: Issue with the downloading url

2008-11-06 Thread Jean-Daniel Dupas
I don't know why it does not works using [NSData dataWithContentsOfURL:URL] but if you want to do some http download, you should use the modern URL Loading API. NSError *error; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://yp.shoutcast.com/sbin/tunei

Re: Issue with the downloading url

2008-11-06 Thread Arnab Ganguly
I am trying out the following NSURL *url = [NSURL URLWithString:@" http://yp.shoutcast.com/sbin/tunein-station.pls?id=9907";]; NSData *data = [NSData dataWithContentsOfURL:URL]; [data writeToFile:@"/tmp/station.pls" atomically:YES]; But unfortunately no such files gets generat

Re: Issue with the downloading url

2008-11-06 Thread Jean-Daniel Dupas
Le 6 nov. 08 à 15:02, Arnab Ganguly a écrit : Hi All, My requirement is to download the html file in my machine.I am trying to execute the below code,it gets executed correctly but when I go to the /tmp dir I don't see any file getting downloaded.Any help would be very much appreciated.

Issue with the downloading url

2008-11-06 Thread Arnab Ganguly
Hi All, My requirement is to download the html file in my machine.I am trying to execute the below code,it gets executed correctly but when I go to the /tmp dir I don't see any file getting downloaded.Any help would be very much appreciated. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[