I'm looking to add a feature to one of my sites that would allow users to send images from their cellular phones to my site. How hard is this?
It is done in just about the same way as a regular upload, but you have to provide some meta tag to tell the cell phone that the page is cell phone campaible. sort of like when you have to do the xml tag for rss feeds. <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>File Upload Example</title> </head> <body> <h1>Welcome to our photo album.</h1> <form action="file_upload.php" method="post" enctype="multipart/form-data"> <p><br/> Choose a photo to upload to the WAP server: <input name="myFile" type="file"/><br/> On the WAP server, save the file as: (Enter something here if you want the file to be saved in a different file name.) <input name="filename" type="text"/> </p> <hr/> <p> <input type="submit"/> <input type="reset"/> </p> </form> </body> </html> Code (markup): Make sure the phones browser is WAP 2.0+ http://www.developershome.com/wap/wapUpload/wap_upload.asp?page=xhtmlmpEg .
Awe, thats for a browser thing. I Should have said this before; I am trying to let them send it to sms@mysite.com and it stores to my server and database.
Fetch the email either with POP3/IMAP etc. or catch it when it arrives, then parse the mail body for the image which will be an attachment. 1) You will need a MIME Parser (lots of sourceforge) 2) and ability to retrieve the email to PHP, so a POP3 or IMAP client or you can set up a forwarder that will send the email to a PHP script.
You will need a mime decoder, as stated above, and then use procmail for the rest. Procmail is tough, and there are no good how-tos that I know of. Getting mine up and running was an utter nightmare.
pop3 RFC - http://www.ietf.org/rfc/rfc1939.txt http://www.phpit.net/article/read-email-php-pop3/ http://www.weberdev.com/get_example-4015.html Plenty of places show you how to do this. Cheers. .
I read those, pretty good, but they don't handle attachments. How does one set up a mail server on their server? Say I have my domain and I want users to be able to register Is that hard to do?