20th Sep 2011, 03:38 AM | #1 |
Web Marketing For Profit War Room Member Join Date: 2002 Location: Brisbane
Posts: 2,895
Thanks: 8
Thanked 1,162 Times in 528 Posts
Blog Entries: 10 |
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 |
DIY Product Creation Online Business Training on How To Create Products to sell online Plus Lots More. | |
20th Sep 2011, 04:57 AM | #2 |
Mobile Warrior War Room Member Join Date: 2011 Location: UK
Posts: 190
Thanks: 616
Thanked 205 Times in 134 Posts
|
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 |
| |
25th Sep 2011, 09:58 AM | #3 | |
Mobile+WP = JumpMobi.com War Room Member Join Date: 2009 Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
|
<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!"; } ?> 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! | ||
Bookmarks |
Tags |
audio, download, mobile, website |
| |