upload photo from iPad

I’m creating a WC solution to be used on tablets, one feature of this solution is the user upload a photo. I know the iPad does not support any kind of filebrowsers so when I try using:

var _file = plugins.file.showFileOpenDialog(1, null, false, null, uploadFileCallback, 'Select upload images')

I do not get to see the browse button in dialog (I kinda was afraid of this)

Is there another option I can use to enable the upload of a photo?

does a media field work? (that is editable)

no, a media fields seems to show the same open-file dialog, which is shown without the browse button

how does an iPad upload something? Do you have a filesystem where you can browser to files for?
Do you see browse buttons in simple html examples?

I don’t think this is possible using a web (browser) app. You can do this using native iPhone or iPad apps, but not from a browser. This is one limitation/challenge for web apps.

I am typing this from my iPhone, and I am not able to add and image from my iPhone album. But I can add images in my Facebook because Facebook has a native iPhone/iPad app.

However, someone in the Java world may have figured a way to solve this. You might have to solve this outside the Servoy world. If you find a solution, please post here.

File system and/or photo library access is only possible with a native app.

If you use phonegap to wrap your web application to run on an ipad (and put it in the app store) you can use their api.
See http://wiki.phonegap.com/w/page/1649478 … mera%20API

rvanderburg:
If you use phonegap to wrap your web application to run on an ipad (and put it in the app store) you can use their api.
See http://wiki.phonegap.com/w/page/1649478 … mera%20API

Excellent! Thank you for this tip.

rvanderburg:
If you use phonegap to wrap your web application to run on an ipad (and put it in the app store) you can use their api.
See http://wiki.phonegap.com/w/page/1649478 … mera%20API

Thx this is giving me hope again to get this working!

i’ve looked at phonegap, is there anyone with experience using this?
Am I reading it right that we need the following:

  • Apple development license
  • a mac to develop the phonegap wrapper for our servoy webclient (I could not find a windows download for phonegap, at least not for a ios version)

If you want to create a native app for iOS then indeed you need to do all that.

jdbruijn:
i’ve looked at phonegap, is there anyone with experience using this?

Hi Jos,
You contacted us, a few weeks ago, about this, and I replied to you by mail, did you got that mail?

yes, we have experience with phonegap & appcelerator.
It is not as simple as Ron (rvanderburg) suggested. The html has to run ON the iPhone, and you can’t just simple embed phonegap javascript code in Servoy, because the webclient, runs in it own html/web-container. But there are other options. Please contact us, if you need help.

This has been done by using a ancillary native app that registers a custom URL scheme that Safari knows to hand off to when the URL is clicked on. Picup is one of those apps [1], there is another whose name escapes me right now that worked for Android as well.

[1] http://picupapp.com/

jdbruijn:
I’m creating a WC solution to be used on tablets, one feature of this solution is the user upload a photo. I know the iPad does not support any kind of filebrowsers so when I try using:

var _file = plugins.file.showFileOpenDialog(1, null, false, null, uploadFileCallback, 'Select upload images')

I do not get to see the browse button in dialog (I kinda was afraid of this)

Is there another option I can use to enable the upload of a photo?

I have a similar issue to this in a JQ Mobile app, so its not Servoy web client specific, fundamentally you can not upload images via mobile Safari its blocked by Apple. Further to access the photo app you effectively close the mobile Safari app hence there is no connection between the two and no facility to upload images.

However there is a potential solution which I am currently working on where by you email your image to a Servoy listener which then extracts the attachment and uploads the image to your server at the same time updating your database. This has three advantages

a) Its possible and
b) Servoy will let you control precisely how the image is handled and deal with any security issues and
c) Photo app has the facility to email already built in so its an easy process.

The caveat to all this is I do not have a finished solution yet so IF I make it work I will let you know !!

HTH
Gordon

jdbruijn:
i’ve looked at phonegap, is there anyone with experience using this?
Am I reading it right that we need the following:

  • Apple development license
  • a mac to develop the phonegap wrapper for our servoy webclient (I could not find a windows download for phonegap, at least not for a ios version)

a) Yes you require and Apple development license (around $99)

b) Yes to use PhoneGap you do require a Mac for iOS

Gordon