You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by bilbosax <wa...@comcast.net> on 2016/09/26 02:34:53 UTC

PHP Service Image Handling Advice

I have just had my first experience with PHP services in Adobe Air.  It is a
very cool feature for communicating with MySQL.  I am also working with
another server interface that is similar to a database and has a PHP
interface to communicate with it.  One of its PHP functions returns images
to a user.  The problem is, I don't know how to work with services in
AIR/FLEX that deal with images.  I don't even know if you can.  I would have
to set up a return type, and I don't know if images can be a return type. 
But there is a second alternative.  The PHP function can also return a bunch
of URL strings for the location of the images instead of the actual photos. 
Either way, I need these images in my AIR application.

Please let me know of any advice for retrieving these images.  Is there a
way to have PHP return images to AIR in a service, or would you just have
PHP return a bunch of URL's for the images and then go get the images in
another way?

Thanks!  



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/PHP-Service-Image-Handling-Advice-tp13625.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: PHP Service Image Handling Advice

Posted by OmPrakash Muppirala <bi...@gmail.com>.
The SQLLite example was just to show that Flex can handle
blobs/bytearrays.  You should be able to replicate the same idea using php
+ your backend database.

Thanks,
Om

On Sun, Sep 25, 2016 at 9:22 PM, bilbosax <wa...@comcast.net> wrote:

> I really appreciate the response, but using SQLite with AIR does not
> require
> PHP as an intermediary and doesn't really answer the question as to whether
> PHP could pass an image to AIR as a service. What I am really looking for
> is
> if this is even possible?
>
> The url approach is a backup and I will use that if necessary, but a
> service
> would be a handy tool if at all possible.
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/PHP-Service-Image-Handling-Advice-tp13625p13627.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: PHP Service Image Handling Advice

Posted by bilbosax <wa...@comcast.net>.
I really appreciate the response, but using SQLite with AIR does not require
PHP as an intermediary and doesn't really answer the question as to whether
PHP could pass an image to AIR as a service. What I am really looking for is
if this is even possible?

The url approach is a backup and I will use that if necessary, but a service
would be a handy tool if at all possible.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/PHP-Service-Image-Handling-Advice-tp13625p13627.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: PHP Service Image Handling Advice

Posted by OmPrakash Muppirala <bi...@gmail.com>.
One way would be store the image as a blob in the database and load it as a
bytearray into an image object in Flex.  This is a good approach when the
images are not too big.  Here is a discussion around doing it with SQLLite;
the approach would be similar [1]

Loading the image as a url over http would work as well, but you need to
have a webserver setup.  With this approach you could make use of the Adobe
AIR's builtin caching mechanisms.

Thanks,
Om

[1]
http://stackoverflow.com/questions/7348318/saving-and-loading-image-to-local-sqlite-blob-using-flex-4-5

On Sun, Sep 25, 2016 at 7:34 PM, bilbosax <wa...@comcast.net> wrote:

> I have just had my first experience with PHP services in Adobe Air.  It is
> a
> very cool feature for communicating with MySQL.  I am also working with
> another server interface that is similar to a database and has a PHP
> interface to communicate with it.  One of its PHP functions returns images
> to a user.  The problem is, I don't know how to work with services in
> AIR/FLEX that deal with images.  I don't even know if you can.  I would
> have
> to set up a return type, and I don't know if images can be a return type.
> But there is a second alternative.  The PHP function can also return a
> bunch
> of URL strings for the location of the images instead of the actual photos.
> Either way, I need these images in my AIR application.
>
> Please let me know of any advice for retrieving these images.  Is there a
> way to have PHP return images to AIR in a service, or would you just have
> PHP return a bunch of URL's for the images and then go get the images in
> another way?
>
> Thanks!
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/PHP-Service-Image-Handling-Advice-tp13625.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>