Quoting Dominic Hulewicz <[EMAIL PROTECTED]>:
> On Mon, Jan 07, 2002 at 02:50:25PM +0000, Simon Crowhurst wrote:
> : I am looking to utilise a Siemens SL45i device to access a web server
> : hosting a MIDP application. The connection type is via a GSM WAP session
> : which routes via an Alligata WAP gateway. Can anyone detail the way in
> : which I need to configure my WAP gateway to provision for this?
> : Currently I get the error "unsupported content type".
You can send it using SMS ;)
You'll have to create the directory directly in the phone (I cannot create it
with sms) and then send the .jar and .jad to that directory.
Yes, I know it's not the best way to do it, but I've tried, with success, to
send the three thousand SMS's to inject a MP3 into the phone ;)
PHP:
// The file uploaded with a POST form
$h=fopen($mmc_file_raw, "rb");
$file = fread($h, filesize($mmc_file_raw));
fclose($h);
$file_size = strlen($file);
$file = join("", unpack("H*", $file));
$file = preg_replace("/(..)/", "%$1", $file);
$max_size = 140 - 22 - 3 - strlen($mmc_file_name);
// mid, lng, jar, jad, mp3, bmp, etc
$file_type = $fields['mmc_file_type'];
$file_name = $fields['mmc_file_name'];
$fields['mmc_file'] = "";
$fields['mmc_file_type'] = "";
// include the directory in the filename
$fields['mmc_file_name'] = "";
$count = 0;
$max = ceil( $file_size / $max_size);
$packet_size = $max_size;
$object_size = sprintf("%08X", $file_size);
$object_size = "%". substr($object_size, 6, 2). "%". substr($object_size,
4, 2). "%". substr($object_size, 2, 2). "%". substr($object_size, 0, 2);
print "max=$max, packetsize=$packet_size, objectsize=$object_size;
file_size: ".$file_size."<p>";
while ($count < $max) {
if ( $count == $max - 1 ) { # Last Packet
$packet_size = $file_size % $max_size;
}
$fields['text'] = "";
$fields['text'] .= "//SEO";
$fields['text'] .= "%01"; # Version 1
$fields['text'] .= "%". sprintf("%02X", $packet_size % 256). "%".
sprintf("%02X", floor($packet_size / 256)); # Data Size on this message
$fields['text'] .= "%00%00%00%00"; # Reference
$fields['text'] .= "%". sprintf("%02X", ($count+1) % 256). "%".
sprintf("%02X", floor(($count+1) / 256)); # Packet Number
$fields['text'] .= "%". sprintf("%02X", $max % 256). "%". sprintf
("%02X", floor($max / 256)); # Max Packets
$fields['text'] .= $object_size; # Object Size
$fields['text'] .= "%". sprintf("%02X", strlen($mmc_file_type)).
$mmc_file_type; # Object Type
$fields['text'] .= "%". sprintf("%02X", strlen($mmc_file_name)).
$mmc_file_name; # Object File Name
$fields['text'] .= substr($file, $count * $max_size * 3,
$packet_size * 3);
#print $fields['text']. "<br>";
#$debug = 1;
sendsms();
$count++;
}
--
Davi