A question about WAP with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

A question about WAP with PHP

Post by Chris Corbyn »

Hi,

<-- You don't need to read this 1st paragraph if you don't want -->

I host a ringtones website and at present users require a data cable to transfer files to their handsets. The download method on my site uses header functions in a download.php which proccesses all downloads and redirects to the files thus covering the URL of the actual file.

I want to allow users who do not have data cables to access my files via wap but I do not intend to run the site on wap too as yet.

All I want to do is to offer the direct download via wap instead by providing a URL such as http://mypolytone.tk/getfile.php?file=132 where 132 corresponds to the number of the file in the same way that I use download.php for Web downloads.

I know how to do this but my only problem is knowing what header functions to use for content-type when working with WAP/ (WML) and also whether you need to add anything special to the code to allow the phone to save the file.

Usually I would use

Code: Select all

header ('Content-Disposition: attachment; filename="somefile.mmf"');
header("Content-type: application/octet-stream");
header ("Content-Transfer-Encoding: binary");
readfile ('somedir/somefile.mmf');
What's the WAP equivalent? I tried this with my samsung x600 and I just got a message saying invalid content-type or something to that effect.

Thanks :-)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

I'm not sure, but you can try:

Code: Select all

Content-Type: application/vnd.smaf
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

He he.

Thanks, vnd.smaf works. Makes my site a lot more user friendly for those people who would have previously visted and left when they realised they needed a data cable.

Cheers :-)
Post Reply