Page 1 of 1

Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 1:40 pm
by Nate Snyder

Hello. I have a working app similar to the one detailed in the clickable list app tutorial that functions like a product catalog. When I view details of an item, I would like to add the capability to display an image for each item. Is there a way to add an image column to an existing database "collection"? I figured out how to display an image stored in the "files" portion of the database using your tutorials and support history, but it seems very tedious to add hundreds of image files and then cross-reference all the URL's in the "collection" of the db.

Thanks!


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 3:28 pm
by Kateryna Grynko

Hi,
I'll take a look and update.


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 7:17 pm
by Kateryna Grynko

Hi Nate,

https://getsatisfaction.com/apperyio/... -- here you can find how to save image in database.

To add several images you would need to upload Image, then read it in Canvas (not a palette component, but the special tag), get there canvas.toDataURL() and send this value to database.

Then the image coded in base64 will be stored in database.


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 7:44 pm
by Nate Snyder

Thanks, Katya.

I looked at the link above, but that shows how to upload images from a mobile device while running an app. I'd like to load the images directly into the backend database from my desktop hard drive during development. I'm not familiar with Canvas. Could you provide some additional details on the steps it would take to do this?


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 8:24 pm
by Kateryna Grynko

Nate,

You would need a console command that you can use with curl to upload images to database.
What is your OS?


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 8:31 pm
by Nate Snyder

I'm on Windows 8...


Is there a way to add images to a backend database "collection"?

Posted: Tue Jun 04, 2013 8:57 pm
by Kateryna Grynko

We'll update.


Is there a way to add images to a backend database "collection"?

Posted: Wed Jun 05, 2013 7:38 am
by Maryna Brodina

Hello! It's not a good idea to store all images in one table with description. Any request to DB (for example you would need to show item name) - automatically requests images (it's an extra traffic which makes app slow). It's better and easier to store images in "files" and in item specify image name. But if you're going to store it in one table:
1) Create in table field with name "file_data" and string type;
2) Upload to this field data from file which was previously encoded into base64. To get that string you can use base64 encoder (downloaded or online encoder).


Is there a way to add images to a backend database "collection"?

Posted: Wed Jun 05, 2013 12:03 pm
by Nate Snyder

Thank you, Marina!

After reading your explanation, it makes sense to store images separately from the main data collection - I don't want to have a slow-functioning app. I also see there are a number of base64 encoder sites on the web. For reference to others, here's a simple site that seems to do the job:

http://webcodertools.com/imagetobase6...

Thanks again...


Is there a way to add images to a backend database "collection"?

Posted: Tue Oct 08, 2013 3:12 pm
by Joe6207668

Hello!

Am I the only one that is only getting the names of the photos in the list item? I'm assuming this service is meant to show photos, and I'm confused how that is possible if we don't include an image in the list with the label.... Or maybe its something I don't understand.

Also for a slow working app, are you saying we should upload the images to the files collection and then call on it, instead of creating a photo collection?

Thanks,
Joe