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 8956579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:49:09+00:00 2026-06-15T14:49:09+00:00

I am trying to download a mp3 file at a given link using NSURLConnection

  • 0

I am trying to download a mp3 file at a given link using NSURLConnection. However, I usually get time-out errors. Entering the link into the browser shows the default player, however the music file is not loaded either:

Downloading mp3's is not illegal in all countries

However, if I create the following simple HTML file:

<html>
    <body>
        <a href="link_to_the_mp3" target="_blank">Download</a>
    </body>
</html>

And then load the file into Safari, right click on the Download link, then select Download to Computer (or whathever it’s called in English), Safari downloads the file.

Any ideas on how I can implement this in my own app?


I tried using

NSData *data = [NSData dataWithContentsOfURL:url];

and

[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *r, NSData *data, NSError *e) { /.../ }];`

without success.

  • 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-06-15T14:49:10+00:00Added an answer on June 15, 2026 at 2:49 pm

    Seems like you’re trying to hit a fly with a sledgehammer, using “NSURLConnection“.

    Try doing something a wee bit more high level such as

    NSData * mp3data = [[NSData alloc] initWithContentsOfURL:options:error: ];

    (the added benefit here is that you can get useful errors back via the “error:” parameter you pass into the method.

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

Sidebar

Related Questions

I am using Android 1.5 I am trying to download mp3 via URL link,
I an trying out a HTTP link to download using a GUI which when
I am trying to download a file from a website using python and mechanize.
I'm trying to figure out how to stream mp3 files using django. I've used
I am trying to download several mp3 files using a script in java. The
I'm trying to get an mp3 file and save it on the phone memory
I'm trying to use Python to download a voice file (mp3) from this site:
I'm trying to download a file using Ruby and Open-URI but I'm running into
I am trying to download mp3 file to users machine without his/her consent while
I'm trying to download a mp3 file generated by google translate and although to

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.