• 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
Re: getting a nsurl file size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting a nsurl file size


  • Subject: Re: getting a nsurl file size
  • From: Eric Smith <email@hidden>
  • Date: Sun, 29 Jan 2012 08:01:46 -0800

The getResource... method returns YES whether I pass @"content-length" or NSURLFileSize (I tried that one first).

Eric


On Jan 28, 2012, at 10:21 PM, Ken Thomases wrote:

> On Jan 28, 2012, at 11:53 PM, Eric Smith wrote:
>
>> I'm trying to determine the size of a file on a server.  If I send the following message to an NSURL named "path", I get:
>>
>> [path getResourceValue:&value forKey:@"content-length" error:&error];
>>
>> value comes back nil.
>
> Two things:
>
> * Did the method return TRUE or FALSE?  If FALSE, what error did you get back?
>
> * The keys that are valid for that method are those listed in the NSURL documentation.  They may bear no relation to HTTP response header fields.  So, I see no reason to believe that "content-length" is a valid key.  Have you tried NSURLFileSizeKey?
>
>
>> If I send:
>>
>> value = [path propertyForKey:@"content-length"];
>>
>> which is deprecated, I get the correct file size.
>
> That may be fluke.
>
> Regards,
> Ken
>

_______________________________________________

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


References: 
 >getting a nsurl file size (From: Eric Smith <email@hidden>)
 >Re: getting a nsurl file size (From: Ken Thomases <email@hidden>)

  • Prev by Date: Subclassing IKImageView
  • Next by Date: Re: getting a nsurl file size
  • Previous by thread: Re: getting a nsurl file size
  • Next by thread: How to parse multipart/form-data?
  • Index(es):
    • Date
    • Thread