• 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
Download file size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Download file size


  • Subject: Download file size
  • From: Marc Laffitte <email@hidden>
  • Date: Mon, 8 Oct 2001 11:08:33 +0200

Hi,

I would like to do a really simple thing: I wish to know the size of a file before downloading it.
I tried the following:

...: (NSString*)inUrl
{
NSURL *tUrl = [NSURL URLWithString:inUrl];
id tFileSize;

tFileSize = [tUrl propertyForKey:(NSString*)kCFURLFileLength];
...
}

But I allways get nil.
The documentation about propertyForKey for an NSURL says "description forthcoming". Well, how should I know wich keys I can use?

I tried with kCFURLFileLength because I first tried using CFURLCreatePropertyFromResource with that propety. However, I either got a kCFURLPropertyKeyUnavailableError error for http:// files, kCFURLUnknownSchemeError for ftp:// files or no error but a zero length result for the file:// scheme.

I suppose I am doing something wrong. Can someone help?

Thanks,
Marc


  • Prev by Date: keyEvent characters
  • Next by Date: Table View Data Source Question
  • Previous by thread: Re: keyEvent characters
  • Next by thread: Re: Download file size
  • Index(es):
    • Date
    • Thread