Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 26th, 2004, 07:06 AM
bhutz bhutz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 265 bhutz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 6 h 37 m 35 sec
Reputation Power: 5
Different way of providing a download

I am hoping someone could lend some expert advice cos I am totally stuck.

I am trying to create a WAP site allowing you to download tones but my tones are stored in a database as a filestring I believe so I can't provide a simple URL to deliver the download.
Is it possible to deliver the download in any other way. I think that at the moment downloads are sent to the user via headers when you access the download via the broswer.
Code:
	header('Content-Type: ' . $filetype);
	header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
	header('Content-Disposition: attachment; filename="' . $filename . '"');
	header('Content-Length: ' . strlen($filestring));

	echo $filestring;

Can WAP devices accept headers in this way to accept file downloads too?

Reply With Quote
  #2  
Old August 26th, 2004, 07:52 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
Quote:
Originally Posted by bhutz
I think that at the moment downloads are sent to the user via headers when you access the download via the broswer.
Code:
	header('Content-Type: ' . $filetype);
	header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
	header('Content-Disposition: attachment; filename="' . $filename . '"');
	header('Content-Length: ' . strlen($filestring));

	echo $filestring;

Can WAP devices accept headers in this way to accept file downloads too?
Yes you can use PHP headers to tell the phone the download it as a file. Just run the code snip about as a seperate file which you link to in the wml and the phone should download the tone
__________________
Andy Moore << oh no it's got a blog.....
Word Press WAP Plugin with Ad Mob Advertising revenue
PHP developer
deploying ringtones, mp3 downloads and realtones
I'm a geek who's obsessed with stats and gadgets

Reply With Quote
  #3  
Old August 26th, 2004, 08:41 AM
bhutz bhutz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 265 bhutz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 6 h 37 m 35 sec
Reputation Power: 5
OK that is good to know.
I was also wondering what headers are needed by my WAP device because I only want to send what is essential.
I guess this is one
Code:
header("Content-type: text/vnd.wap.wml");

What else does the phone need? Or can I simply use
Code:
echo $filestring;

Reply With Quote
  #4  
Old August 26th, 2004, 09:09 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
Quote:
Originally Posted by bhutz
OK that is good to know.
I was also wondering what headers are needed by my WAP device because I only want to send what is essential.
I guess this is one
Code:
header("Content-type: text/vnd.wap.wml");

What else does the phone need? Or can I simply use
Code:
echo $filestring;

No you don't want to have wap.wml headers on a file download! You'll need to set the headers for audio/mid or audio/midi and so on for the files the user is downloading otherwise the server will output the data of a midi file and tell the phone it's a wap page which would be pretty numb.

I must introduce a policy of not trying to help people who want to give away ringtones as if you all suceeded i'd make no money, wouldn't be able to eat and would have to get a proper job and that is the last thing I want!


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > Different way of providing a download


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway