Nokia Liveblog Image Uploading – Part 1

I’m calling this part 1, because I hope to follow it up at some point, although… who knows!

I wanted to be able to upload my photos from my N95 directly to my website, and notice that S60 phones appear to have an option to upload to Flickr and Vox using the ‘online services’ system, so I figured adding my own shouldn’t be too hard. After a bit of googling, I found this:

lifeblog_posting_protocol_specification_1.0.pdf

Having the spec made it pretty trivial. My examples below are using symfony, but are really very basic, so you should be able to figure it out. At some point, I intent to make a class to handle this, and maybe release it. Currently, the data is stored in a database ‘as-is’, but processing it wuold be trivial

If you don’t understand how this works, read the spec. If you still don’t understand, don’t contact me about it unless you’re willing to pay for implementation 😉

 # apps/frontend/modules/nokia/actions/actions.class.php
getResponse()->setStatusCode(201);

    $stream = fopen("php://input", "r");
    $data = stream_get_contents($stream);
    fclose($stream);

    $n =  new Nokia();
    $n->body = $data;
    $n->save();
  }
}
 # apps/frontend/modules/nokia/templates/indexSuccess.php
'; ?>

  
  
  
  
  

  # apps/frontend/modules/nokia/templates/postSuccess.php
'; ?>

  Test
  moo
  2004-11-16T13:04:04Z
  
  testmoo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.