I am trying to load a file queue using ASIHTTPRequest. Each request constantly fails. I know the URLs are correct, I traced them and pulled them into the browser, and there are files. I have few ideas on how to debug this.
-(void) getRemoteFiles:(NSMutableArray *) M { [self createFileToAppDirectory]; if (!networkqueue) { networkqueue:[[[ASINetworkQueue alloc] init] autorelease]; } [[self networkQueue] cancelAllOperations]; [self setNetworkQueue:[ASINetworkQueue queue]]; [[self networkQueue] setDelegate:self]; [[self networkQueue] setRequestDidFinishSelector:@selector(requestFinished:)]; [[self networkQueue] setRequestDidFailSelector:@selector(requestFailed:)]; [[self networkQueue] setQueueDidFinishSelector:@selector(queueFinished:)]; int i; for (i=0; i<[M count]; i++) { NSString *url=[M objectAtIndex:i]; NSString* theFileName = [url lastPathComponent]; if ([theFileName isEqualToString:@"nothing"]==NO) { ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]];
EDIT
I think I found the problem, but I do not know how to fix it. If I change the request URL to something simple, like http: //mysite/content/track.mp3 , everything works fine. But when I use the source url, the request fails. The original url is as follows:
http://site-media.s3.amazonaws.com/2020 Vision - Deep Tech House and Techno / P_122_DrumLp6.mp3
I think this might have something to do with spaces, but I thought nsurl would handle this stuff?
source share