• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
decidePolicyForMimeType to download?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Scaling CGPDFPageRefs
  • Next by Date: Re: Scaling CGPDFPageRefs
  • Previous by thread: Re: Changing CALayer's contents too rapidly causes CoreAnimation to implode?
  • Next by thread: Making a scrolling text field.
  • Index(es):
    • Date
    • Thread