2

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.

7
  • 1
    Android can downlaod files from the web.
    – cjk
    Jul 26, 2012 at 15:54
  • are you looking for a code example?
    – elconejito
    Jul 26, 2012 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, 2012 at 21:16
  • 1
    @Hope4You: "answer" = "question"?
    – MrWhite
    Jul 27, 2012 at 0:57
  • 1
    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"'); Jul 27, 2012 at 17:49

3 Answers 3

1

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

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

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.

0
0

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
1
  • Yes, but I was looking for a way to do it directly from the web/PHP.
    – Hope4You
    Jul 26, 2012 at 14:31
-1

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.

2
  • -1 How does your answer address the asker's question? Are you affiliated with iDownloads PLUS?
    – danlefree
    Jul 27, 2012 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, 2012 at 19:03

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