SourceForge.net Logo
Blurred Vision version 1.0 BETA
==============================================================
https://sourceforge.net/projects/blurredvision
==============================================================
This software is Copyright (c) misterbig. All rights reserved.
==============================================================
This software is published under the Zope Public License 
(zpl.txt). Please read it!
==============================================================

This tool is a single PHP script that will allow you to send 
images to your Sprint PCS Vision enabled phone without having 
to pay Sprint to get images. It requires a web server that 
supports PHP. It has only been tested on Apache 2.0 with PHP 
4.2 on Win32. There is absolutely nothing in this script that 
would tie it to a particular platform, though. It does require 
that file uploads be enabled on the server, because the file 
to be sent to the phone must be saved somewhere until the 
person downloads the file. It also requires that you be able 
to set a new MIME type on the server itself; I've included 
instructions on how to set a new MIME type for Apache 2.0, 
but it is up to the user to figure out how to add a new MIME 
type in other web servers. Finally, it requires access to an 
SMTP server to send an SMS notification to the user's phone 
alerting them that there is a new file for them to download.

The script works by accepting three things from the user: the 
file they wish to send to their phone; the title for the file 
that will be used by the phone; and the phone number to which 
the file should be sent. PCS phones must receive specially 
formed SMS messages that point to a description file of the 
actual image file before it can download it, and the script 
uses the information entered to make that file and email it 
to the phone.

Sending an SMS message is as simple as sending an email to 
your-phone-number@messaging.sprintpcs.com (e.g., 
1234567890@messaging.sprintpcs.com). To download something, 
the SMS message must be a plaintext URL that points to the 
appropriate description file (e.g., 
http://domain.com/files/myfile.gcd). When the phone opens 
this message, it sees that it's pointing to a GCD and prompts 
you to go to that URL. When it opens the file in the browser, 
it automatically recognizes the file as a description file 
that is pointing to an actual image. It reads that information, 
which includes the URL of the image, and redirects the browser 
to the image. The phone will then prompt you to save the image 
and makes it available as a wallpaper.

The description file must be crafted thusly:

Content-Type: image/jpeg
Content-Name: title-the-user-enters
Content-Version: any-value-you-want
Content-Vendor: your-name-and-claim-to-fame
Content-URL: http://domain.com/files/image-name.jpg
Content-Size: file-size-in-bytes (e.g. 1028)
(you must put a blank line here)

Pretty simple, huh? It took a while to figure out all this 
information, so I would like to thank all those persons who 
figured out this information the hard way: by doing it 
themselves. I owe you a debt.

The script (visionupload.php) is heavily commented. You should 
have no trouble editing it to your needs. If you are attempting 
to use this on a non Win32 system, you will need to edit the 
paths listed to use forward slashes instead of back slashes.

The SMTP server through which you send the message must allow 
relaying by the IP address of the web server. Otherwise, you 
will not be able to use the script.

There are six files in this archive. This file, the Zope Public 
license (zpl.txt), the page with the form (default.htm), the 
PHP script (visionupload.php), and the header and footer for 
the final displayed page (header.php, footer.php).

As mentioned, the description file (the GCD file) must have a 
custom MIME type set, otherwise it will send the file as text, 
which the phone cannot correctly interpret. To set the type 
in Apache 2.0, you must add the following line to httpd.conf 
and restart Apache:

AddType text/x-pcs-gcd .gcd

Since this is just the 1.0 beta release of the script, it 
only supports sending JPG files. Please see the TODO section 
below for information on support that I plan to add.

Also, please be aware of the restrictions the tool currently 
has. Aside from only supporting JPGs, the file name cannot 
have spaces in it. This is a limitation of the phones, and 
if there are spaces they will be removed. Files cannot be 
more than 64 KB either, again as a limitation of the phones. 
Some phones will also reject images that are too large in 
dimension, so you will have to experiment to find a good size, 
though generally 110x110 will be around the maximum. I've 
limited the length of the filename to no more than 25 
characters because I don't know the compatibility the phones 
have with very long filenames. Finally, the phone number to 
which the user wants to send the file must be in the 
1234567890 format only.

- TODO -

*Add support for other image types (PNG, WBMP)
*Add support for ringers (MIDI, qcp)
*Make all files have random string appended to them for 
 security purposes
*Get better error handling
*Get auto-deletion of files setup after a certain amount of 
 time has elapsed.
*Maybe remove the actual writing of a GCD file and instead 
 setup a PHP script to generate the file on the fly and 
 send itself as a particular MIME type.
*Figure out the best license under which to publish this
*Any other suggestions as they come.

Help is greatly appreciated in making this tool better. Feel 
free to contribute. If you have any ideas, feature requests, 
bug reports, kudos, death threats, please email them to 
misterbig@users.sourceforge.net.

PayPal donations could be made to hramyaegr@hotmail.com. I 
mean hey, you probably would've paid a buck to Sprint to 
download from them after all, right?

EOF