problem with get Device.Image.getFromPhotoLibrary();

8 views
Skip to first unread message

Bunsenator

unread,
Mar 15, 2009, 5:57:30 AM3/15/09
to Big Five Safari iPhone Apps
Device.Image.callback = safire.procPhoto;
Device.Image.onerror = safire.procPhoto;
Device.Image.destination = safire.server;
Device.Image.getFromPhotoLibrary();

The above code allows me to pick an image but after doing so - I am
returned with...

3/15/09 5:45:17 AM project[13797] javascript:
__device_did_fail_image_upload('Error Domain=NSURLErrorDomain
Code=-1002 UserInfo=0x5952f0 "unsupported URL"');

Note that safire.server AND the app are on the same webserver with the
same root and I am running the simulator 2.2.

Bunsenator

unread,
Mar 15, 2009, 6:39:15 AM3/15/09
to Big Five Safari iPhone Apps
I found a fix - starting on line 217 - you are setting the
Device.Image.Destination - but not the destination that is local to
that method. I added in 1 line of code to make my code work:

Device.Image.destination = destination || Device.Image.destination
destination = destination ? destination : Device.Image.destination;
// throw "Destination needed"

Bunsenator

unread,
Mar 15, 2009, 7:48:41 AM3/15/09
to Big Five Safari iPhone Apps
I'm now trying to figure out how to get the photo on the server side -
PHP - any thoughts anyone?

Bunsenator

unread,
Mar 16, 2009, 12:13:11 AM3/16/09
to Big Five Safari iPhone Apps
This was answered in a previous thread:

<?php

$filestream = stripslashes($_POST['data']);
$worked = file_put_contents("iphonepicload.jpg", $filestream);

?>

ueilat

unread,
Mar 16, 2009, 7:14:36 AM3/16/09
to Big Five Safari iPhone Apps
http://groups.google.de/group/big5apps/browse_thread/thread/9a22308de13c9399?hl=en
> > > > same root and I am running the simulator 2.2.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages