Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to download digital goods to smartphone users (music in format .mp3 or .zip). But iPhone and iPad do not allow direct forced downloads.

How can I provide mobile users with digital downloads? I use PHP.

The only way I can think of to do this is to use the Dropbox Web API to transfer files to the user's Dropbox account, which then synchronizes with their mobile device.

Any other suggestions would be appreciated.

share|improve this question

closed as off topic by Lèse majesté, Su', John Conde Dec 31 '12 at 20:17

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Android can downlaod files from the web. – cjk Jul 26 '12 at 15:54
are you looking for a code example? – elconejito Jul 26 '12 at 19:18
@elconejito I am just trying to figure out if it's even possible, so yes a code sample would be fine. – Hope4You Jul 26 '12 at 21:16
@Hope4You: "answer" = "question"? – w3dk Jul 27 '12 at 0:57
Can someone help me understand what exactly happens when you click a web link pointing to a .zip or .mp3 on an iPhone? Does it simply not work? Does it pop up a security notice and then just bail? I don't have an iphone and I'm wondering if it is simply a matter of sending the correct content-disposition header. Example header('Content-Disposition: attachment; filename="downloaded.mp3"'); – Anthony Hatzopoulos Jul 27 '12 at 17:49

I'm not sure exactly what you need, but it is possible to have a mobile platform (iOS, Android, etc) download a file. With some minor quirks, mobile browsers behave just like their desktop counterparts.

You can provide the user with a direct link like http://example.com/somefile.zip

If you need to do some processing via PHP first, it can look like

// can I download this file
if ( $itsoktodownload == true ) {
  // some code here
  header("Location: http://example.com/somefile.zip);

Basically, that code snippet is just redirecting the user to the url of the downloaded file.

If you need something more specific, like you need to force it to download (instead of attempting to "open"), or you need to control the headers sent first, or you are trying to hide the real location of the file (so people can't share the link around), there are many download scripts available via google.

You could ask a more specific question once you've gotten into it a bit.

share|improve this answer

You can use any of:

  1. A custom application (although, at least on iOS, you won't be able to add mp3s to the main music library on the device)
  2. The official stores (iTunes / Google Play / 3rd Party Android Stores)
  3. A download the user can access on their desktop and then sync to their mobile device
share|improve this answer
Yes, but I was looking for a way to do it directly from the web/PHP. – Hope4You Jul 26 '12 at 14:31

iDownloads PLUS is great iOS application which helps to download mp3 and Zip files. It also includes many advanced features for zip extract, music playlist and many others additional work.

share|improve this answer
-1 How does your answer address the asker's question? Are you affiliated with iDownloads PLUS? – danlefree Jul 27 '12 at 10:38
I don't want the people to have to use a third-party app like this... My only exception, as stated above, may be Dropbox. – Hope4You Jul 28 '12 at 19:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.