decidePolicyForMimeType to download?
decidePolicyForMimeType to download?
- Subject: decidePolicyForMimeType to download?
- From: "Mitchell Hashimoto" <email@hidden>
- Date: Thu, 24 Jan 2008 16:16:54 -0700
Hi,
I'm trying to use WebKit's policy delegate to intercept zip files and
download them. I have the following code and I am going to a website
to intercept the file. It is working that much... but the download
always results in a big error somewhere (GDB loads up and the highest
thing on the stack trace is obc_msgSend for a callback):
- (void)webView:(WebView *)sender decidePolicyForMIMEType:(NSString
*)type request:(NSURLRequest *)request frame:(WebFrame *)frame
decisionListener:(id < WebPolicyDecisionListener >)listener
{
if ([type isEqualToString:@"application/x-gzip"]) {
[listener ignore];
WebDownload *down = [[WebDownload alloc] initWithRequest:request
delegate:self];
[down setDestination:@"/Users/mitchellh/Desktop/test.tgz" allowOverwrite:YES];
NSLog(@"Downloading");
return;
}
[listener use];
NSLog(@"%@", type);
}
Does anyone see anything wrong?
Thank you
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden