Alan Fernandez
Posts: 0
Joined: Sat May 17, 2014 4:28 pm

Retrieve files from Non-File Collection

How do you retrieve an image from a collection in the database, NOT THE FILE COLLECTION, and store it locally so that it can be displayed in an image component? Using just a request doesn't display the image, it shows a broken image link.

I've browsed the forum but found only how to do it with the file collection and a direct link to the item.

I'd like to not use the file collection to simplify the process of adding new entries to the database by the customer.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Retrieve files from Non-File Collection

Hi Alan,

You can store files only in Files collection. In other collections you can store only a file content.

Could you please clarify how you store file not in Files collection and how you request it?

Alan Fernandez
Posts: 0
Joined: Sat May 17, 2014 4:28 pm

Retrieve files from Non-File Collection

In the appery database there is a "File Collection" and you can create other collections yourself.

I created a collection and added a column called "Image" and its type: "File"
I would like to retrieve that file from that collection.

a href="http://s29.postImage
/a

So this is not possible?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Retrieve files from Non-File Collection

Hi Alan,

You can use this custom collection to store images in.

But you need to store image in base64URL.

See details here:

http://en.wikipedia.org/wiki/Data_URI...

Here you can try to convert image to base64 format: http://websemantics.co.uk/online_tool...

Here you can find info how to read file from input(type=file) this base64 img.

https://developer.mozilla.org/en-US/d...

Regards.

Return to “Issues”