|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
WML - PHP script isn't working, is their an alternative?
I am creating a ringtone website and I designed it so that the user can browse all my ringtones through his/her mobile phone, and once he/she clicks on a ringtone he wants, it will automatically download. The PHP script works fine on my computer, but when trying this on my phone, I get an error message.
Heres my script: this page is called download.php Code:
<?php
$saveName = stripslashes($_GET["name"]);
$savePath = stripslashes($_GET["path"]);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$saveName");
header("Content-Transfer-Encoding: binary");
header("Content-length: " . filesize($savePath));
readfile($savePath);
?>
Anf on the actual wap site I use this link to download the ringtones: Code:
<a href="download.php?name=ringtone.qcp&path=/qcp/ringtone.qcp">Download Ringtone</a> Why wont this work on a phone? and if it is not possible for this to work on a phone, is their an alternative way to have my users download a ringtone? |
|
#2
|
||||
|
||||
|
Hi Northern Flame, welcome to Dev Shed.
Please take a look at the FAQs on please read ... and then try to explain what "doesn't work" actually means ![]() You say you have an error message - what error's do you get? What phone are your trying to use? Got a working link? doesn't work ![]()
__________________
Cheers, Jamie # mdb4u | mobile movie database] | Please help to test and promote # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure __________________ Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. ![]() __________________ Last edited by jabba_29 : July 17th, 2007 at 11:02 PM. |
|
#3
|
||||
|
||||
|
Hello Northern Flame, and welcome to Dev Shed!
Quote:
What is the error message?
__________________
|
|
#4
|
|||
|
|||
|
Sorry about that,
the message I get is "Content Type Not Recognized" and when I tried linking directly to the ringtone Code:
<a href="/qcp/ringtone.qcp">Ringtone Name</a> I get an "500 Internal Server Error" The phone I use is a Motorola and my service provider is Metro PCS, I know that my phone accepts QCP ringtones because I have used a free service before to send my ringtones to my phone, I believe it was called "Mobilatory Send To Phone". And, when I record something through my phone it saves as QCP (PureVoice File) |
|
#5
|
||||
|
||||
|
Does your server understand what that file type is?
If you are on an Apache host, you should (provided you have correct permissions) be able to add the following into .htaccess file in your root directory. Better still to add to your actual httpd.conf file, but if you are on shared hosting you probably won't be able to. Let us know if this helps. See this article, should help you out a bit. Contains links to useful resource site too. Last edited by jabba_29 : July 18th, 2007 at 12:26 AM. Reason: added link |
|
#6
|
|||
|
|||
|
I am on a shared host,
but so far my host company has been able to add anything I request, So I will ask about this, thanks for the help and I will reply if this works |
|
#7
|
|||
|
|||
|
wooo hoooo!!!!!
it worked! well, now I can view the QCP file, how do I make it downloadable to a mobile phone? |
|
#8
|
||||
|
||||
|
Have you tried application/force-download instead of
application/octet-stream? |
|
#9
|
|||
|
|||
|
um....
I dont know what that is lol, can you explain please? |
|
#10
|
||||
|
||||
|
In your header() function:
PHP Code:
|
|
#11
|
|||
|
|||
|
oh lol,
where do i place this? |
|
#12
|
||||
|