How to detect that the mobile content has been downloaded successfu...

How to detect that the mobile content has been downloaded successfu... SearchSearch
Author Message
Aswin Setyawan Margono
New member
Username: Juve7

Post Number: 2
Registered: 05-2004
Posted on Tuesday, March 29, 2005 - 06:30 am:   

Hi all !

I'm maintaining a server for mobile content provider that let someone/customer
download mobile content which is stored in our server via GPRS.

My question is:
1.
For the moment I'm using PHP function fopen & fpassthru to make my customers get their mobile content via GPRS. This is done when they browse to the page :
getrequest.php?id=21&msisdn=628563087450, for example.

In this page the ID & MSISDN is checked and if it is valid then the content (polytone, color wallpaper, etc) are pushed to their mobile phone using this PHP script :

header("Content-Type: audio/midi");
header("Content-Disposition:inline; filename=".basename($path));
header("Content-length: ".filesize($path));
$ambil=fpassthru($file);
fflush();

However I never found a way to be sure that this file was successfully downloaded.
Because I need to store that information into the database (Information if they had succesfully download the polytone, color wallpaper, etc).
Because I need this information for billing purposes.

Anyone here found a way to detect the end of a download via fpassthru or maybe by fread or readfile or any other function maybe ?

2.
How to detect that my customer are downloading the content via their mobile phone browser (by GPRS) because I've seen that they can do that via PC browser (by internet explorer) too.
How can I solve this problem? Because I need to restrict my customer so that they can only access my server via their mobile phone only (by GPRS)?

Thanks a lot in advance !
Deepkamal
Unregistered guest
Posted on Thursday, September 29, 2005 - 10:45 am:   

as u are programming in PHP, u can use
$_SERVER['HTTP_USER_AGENT']
http header to check what kind of browser is accessing your page, like in case of nokia it is simply Nokia model number like Nokia 6610 , same is for all manufacturers,so that if u get Mozilla, or Opera then u can deny the request,
and hey if u r going through operators private GPRS then u can have MSISDN forwarding , so that u'll be having another header like or
$_SERVER['HTTP_MSISDN'] so that if this header is present then it means page is bieng accessed via valid GPRS gateway provided by Operators.
Simon Orr
New member
Username: Basiclife

Post Number: 2
Registered: 11-2005
Posted on Friday, November 25, 2005 - 05:14 pm:   

Further note: bear in mind that mozille allows you to change the user agent header through the use of a plugin. Also, Programs like WinWAP report themselves as mobile phones to allow testing - so your server may not be able to distinguish betweent he 2.

Afraid I onlt have problems not solutions :S
Neyaz
Unregistered guest
Posted on Tuesday, January 10, 2006 - 04:58 am:   

Hi,

I am trying to download a theme name Pink_Girl.sis on Nokia 6600 through WAP site. Size is 298 kb.Its giving an error -- web : unsuppoted content type.

I have transfered the theeme to the handset through IR and its Working.

Please help.
DeepKamal
Unregistered guest
Posted on Tuesday, January 10, 2006 - 06:02 pm:   

u need to set MIME Type in your web server, like in apache u can set it in MIMETYPES.conf and in IIS go to properties of website and then documents, this problem may be coming becoz web server is showing the content of SIS file , not disposing!!!
deepkamal singh
deepkamal@gmail.com
Anonymous
 
Posted on Wednesday, February 15, 2006 - 09:27 am:   

Hi,

A strange problem is happing. while downloading a wallpaper on the handset, its taking the filename of the souce code file name. Actually it should take the file name of the image or wallpaper.

suppose the filename of the wallpaper is "Flower Girl.jpeg" which i want to download on the handset.
Wallpaper is getting download on the handset.
But its saving by the name "testspiceprocesswall".
"testspiceprocesswall" is the souce code file name "testspiceprocesswall.php"


Following syntax i have written for downloading a wallpaper.

$id="Flower Girl.jpeg";
header("Content-type: image/jpeg; name=$id");
header("Content-Disposition: attachment; filename=$id");
header("Pragma: no-cache");
header("Expires: 0");
$chunksize = 1*(1024*1024); // how many bytes per chunk
$buffer = '';
$handle = fopen($id, 'rb');
if ($handle === false) {
return false;
}
while (!feof($handle)) {
$buffer = fread($handle, $chunksize);
echo $buffer;
}

Any help would be appreciated.

Thanks allot.
DeepKamal
Unregistered guest
Posted on Monday, March 06, 2006 - 05:31 am:   

only one thing i can point out
u should use echo html_entity_decode($buffer) instead of echo $buffer
although whole code seems fine to me, but still there can be some configuration from IIS or Apache which ever u may b using, chk out for that.... all the best,
hey u can contact me @ deepkamal@gmail.com
DeepKamal Singh
Deep kamal Singh