Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7509051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:47:40+00:00 2026-05-29T22:47:40+00:00

I have an mp3 file on a server. I want to get this file’s

  • 0

I have an mp3 file on a server. I want to get this file’s information like what’s the size of this file, what’s the artists name, what’s the album name, when was the file created, when was it modified, etc. I want all this information.

Is it possible to get this information without actually downloading the whole file? Using NSURLConnection or otherwise?

EDIT:

The following code doesn’t give me the required information, i.e. file created by, artist name, etc

    NSError *rerror = nil;
    NSURLResponse *response = nil;

    NSURL *url = [NSURL URLWithString:@"http://link.to.mp3"];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    [request setHTTPMethod:@"HEAD"];

    NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&rerror];
    NSString *resultString = [[[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding] autorelease];

    NSLog(@"URL: %@", url);
    NSLog(@"Request: %@", request);
    NSLog(@"Result (NSData): %@", result);
    NSLog(@"Result (NSString): %@", resultString);
    NSLog(@"Response: %@", response);
    NSLog(@"Error: %@", rerror);

    if ([response isMemberOfClass:[NSHTTPURLResponse class]]) {
        NSLog(@"AllHeaderFields: %@", [((NSHTTPURLResponse *)response) allHeaderFields]);
    }

The “AllHeaderFields” is:

AllHeaderFields: {
    "Cache-Control" = "max-age=0";
    Connection = "keep-alive";
    "Content-Encoding" = gzip;
    "Content-Type" = "text/plain; charset=ascii";
    Date = "Fri, 17 Feb 2012 12:44:59 GMT";
    Etag = 19202n;
    Pragma = public;
    Server = dbws;
    "x-robots-tag" = "noindex,nofollow";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:47:41+00:00Added an answer on May 29, 2026 at 10:47 pm

    Yes and no. Things like the file size and modification date often come as part of the HEAD response. But not always: with a lot of dynamic URLs, you won’t get all of the information.

    As for the artist and album name, they’re part of the MP3’s ID3, which is contained inside the file, and so you won’t be able to get them with a HEAD request. Since the ID3 tag is typically at the beginning of a file, you could try to grab just that part and then read the ID3 tag. But you won’t be able to do it with NSURLConnection since it doesn’t support just fetching part of a file, so you’ll need to find a more low-level way of getting data by HTTP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to split a file(suppose a mp3) into four parts.I have tried this
I have a mp3 file on my server. And i want all my clients
I have an mp3 file in my site. I want to output it as
I want to have a program that reads metadata from an MP3 file. My
I have an mp3 encoding server running on Ubuntu (natty). This has been working
I have mp3 files on my server that I want to be accessed via
I have an mp3 on an apache server. I want it to be downloaded
I want to download a file from server to a local host. i have
Hi I want to play a mp3 file via my server e.g. http://test.com/hi.mp3 At
I have a long mp3 file hosted on a standard apache server (30 minutes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.