Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 20th Sep 2011, 03:38 AM   #1
Web Marketing For Profit
War Room Member
 
Quentin's Avatar
 
Join Date: 2002
Location: Brisbane
Posts: 2,895
Thanks: 8
Thanked 1,162 Times in 528 Posts
Blog Entries: 10
Default
Download audio from mobile website
Share on: 
fb share twitter share gplus share more share

I have a customer that want to be able to let people download their speech from their mobile website. I added the p3 file which plays fine but it cannot be downloaded.

Anyone know how you can organize a download.

Quentin

Quentin is offline  
Unread 20th Sep 2011, 04:57 AM   #2
Mobile Warrior
War Room Member
 
Neil B's Avatar
 
Join Date: 2011
Location: UK
Posts: 190
Thanks: 616
Thanked 205 Times in 134 Posts
Default
Re: Download audio from mobile website
Share on: 
fb share twitter share gplus share more share

I think if I remember correctly there's an 'app' called Beam Me Up Scotty that lets you download files straight to your smartphone though not sure if it's what you're looking for Q...if it is then you'll need to add a link on the page

Neil B

Neil B is offline  
Unread 25th Sep 2011, 09:58 AM   #3
Mobile+WP = JumpMobi.com
War Room Member
 
Jay Moreno's Avatar
 
Join Date: 2009
Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
Default
Re: Download audio from mobile website
Share on: 
fb share twitter share gplus share more share

Originally Posted by Quentin View Post

I have a customer that want to be able to let people download their speech from their mobile website. I added the p3 file which plays fine but it cannot be downloaded.

Anyone know how you can organize a download.

Quentin
Hi Quentin,

<WARNING GEEK TALK>

You have to pass the file name variable over to another file that handles the file type to enable to be register as a downloadable attachement... sounds kinda technical i know - sorry i dont know any other way to explain it... you would create a link/button as follows:

http://www.yourdomain.com/download.php?file=123456

Then the download.php would be something like this:

Code:
<?php
$file = htmlspecialchars($_GET['file']); //get file name from url
$download = "download-".$file.".mp3"; //reconstruct actual filename 
include("class/validate.php"); //include validation script
if (Validate::Number($file)){ // Validate file if valid file name continue to download
header("Content-Type: application/octet-stream; ");
header("Content-Transfer-Encoding: binary"); 
header('Content-Disposition: attachment; filename="'.$download.'"');
readfile("http://www.yourdomain.com/downloads/$download");
}else{ // handle non valid file names ie config.php
echo "Your really want our $file file - Come on don't be silly now!";
}
?>
what your seeing is we are making sure the filename sent from the initial link is a number this prevents someone trying to inject say config.php or configuration.php and which prevents people trying to steal data files with sensitive date

if you see we also don't send the file extension and simply add that during the process - again that prevents someone trying to execute a script too

additionally we have our own validation script that checks and makes sure the variable is a number too... and then tells the script to proceed... you can see in the else statement we handle non numeric variables in a casual manner! lol

what you could do if you want to download a keyword rich domain file name you could simply say do a conditional statement like:

if file = 123456 download this file 80s-disco.mp3

</WARNING GEEK TALK>

if this looks/sounds like a bunch of static white noice lol or you need more info or even to outsource this to us just drop me a PM

cheers,

Jay

Sorry, I am too busy helping people to think of a cool signature!
Jay Moreno is offline  
Closed Thread


Bookmarks

Tags
audio, download, mobile, website


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:05 PM.