upload photos from cell phone to server, possible?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
mscir
Forum Newbie
Posts: 1
Joined: Sun Jan 18, 2009 8:44 pm

upload photos from cell phone to server, possible?

Post by mscir »

I'm making a site for a bicycle courier business and I'd like add a feature
that would allow the couriers to snap photos on their cell phones then
upload them directly to the server, where they will be displayed as the
"Photo of the Day".

Each upload would overwrite the existing file so they would always be
uploaded to the same folder with the same filename.

If anyone has experience doing this I'd really appreciate hearing how
they did it, what problems they ran into with server security restrictions
or different types of phones, etc.

Thanks,
Mike
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: upload photos from cell phone to server, possible?

Post by volomike »

You'll want to ensure the photos are real and not some PHP script that someone renamed as a JPEG. Several people have been hacked that way. If you use the getimagesize() API and don't get a valid result, it's not an image.

I guess you could create an Internet email address that receives the cell phone photos, and then those with the ability to send to that would have a way to do it. But a lot of people simply have SMS and MMS. MMS is the only one that can send photos, so then I guess you'd have to find some kind of MMS gateway out there so that you could give people an MMS phonenumber they could register in their phone, and then you could receive the data over this MMS gateway. I googled on MMS gateway -- they exist.

I don't have an iPhone or the brand new, browsable iPod. Do you? If you do, build a web page on the internet with something like this:

<form>
<input type="file">
</form>

...and then browse to it with the Safari browser on that device. Click the Browse... button. Does it let you select local image files? If so, then the iPhone or iPod let you upload images from it like any normal person's computer with a web browser. The only catch is that the image format might be different, but I doubt it. I would reason to bet that the images on the iPhone and iPod are probably ordinary JPEGs.

To me, it seems that the most inexpensive (for the end user) option, and the one that works across the largest variety of phones, is to subscribe to a service that gives you an MMS gateway. The MMS gateway, then, will give you images, sounds, videos, and you can decide which ones of these you will accept. Perhaps they can charge you only for the images and deny all the rest. Anyway, if a service like this works, I would imagine that on your website you would have some kind of message like, "Use your cellphone add a new phone number contact 904-323-0333. Use the MMS feature on your cell phone to send the photo to that contact." And then you could have them type in a PIN in the subject of the MMS so that the PIN matches up with some ID on your site.
Post Reply