Page 1 of 1

Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Sat May 04, 2013 7:13 pm
by CarmeloMilian

I want to do a sales catalog. Items with descriptions and images. How can I do this, is there a good example? I tried saving images to the database before but was not able to retrieve them in an per item way.


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Sat May 04, 2013 8:22 pm
by Igor

Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Mon May 06, 2013 3:24 pm
by CarmeloMilian

Thanks for the link Igor,

It was not what i need, maybe I didn't explain well. I need to be able to store products in the database and retrieve them in a list. The challenge for me has been listing this products with their images. Cant get images displayed.


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Mon May 06, 2013 4:09 pm
by maxkatz

Can you show us what you tried and what doesn't work? You can place an image inside a grid or a list, for example. Then, map an image URL coming from a service.


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Mon May 06, 2013 5:34 pm
by CarmeloMilian

I dont have the code, i wanted to make sure I can do this before I start the project. I was trying at another project and had to launch without images.

the problem is that images need to be uploaded as files and the get service would not give them the file hyperlink at the time of uploading the file so that I can use it to display the image later.

What I wanted to do was the following, Put an new record to that database that includes the hyperlink of an image that will also be added to the file database at the same time. this was impossible for me to figure out last time.


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Mon May 06, 2013 6:02 pm
by maxkatz

When you upload a file, you do get the URL back: http://docs.appery.io/documentation/b...


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Mon May 06, 2013 7:37 pm
by CarmeloMilian

I do realize that the issue is more lack of knowledge on my part, but can you help me figure out how using this I could upload the image. I dont see the file to be uploaded in this example. Can this be some via the services tool within the die?

File API
File API allows uploading and download of files. The following API is available:

Note that all File API requires sending X-Appery-Session-Token header. You can get its value when a user is signed in. This is to prevent any one but the user uploading any number of files.

Uploading Files

curl -X POST
-H "Content-Type: [set_to_file_type]"
-H "X-Appery-Database-Id: 498ad4r0e4b9348a121cf6ea"
-H "X-Appery-Session-Token: 900ad7b0e4b9808a456cf5ba"

]https://api.appery.io/rest/1/db/files...
For example, if the file name you want to upload is ABC.jpg, the URL will be:

https://api.appery.io/rest/1/db/files...
The JSON response will look like this. The actual file name is pre-pended with a random id to make the names unique. This is the actual file name under which the file is stored in the database:

{"filename":"cc30aa08-3d30-4236-a2fc-8c7a768d02c6.ABC.jpg", fileurl: 'https://api.appery.io/rest/1/db/files...'}


Create sales catalog? Can seem to be able to add images and be able to list them with the items.

Posted: Tue May 07, 2013 12:36 am
by maxkatz

Uploading: http://docs.appery.io/tutorials/uploa...

If you are new to mobile, I highly recommend you start with some of the beginner tutorials and then intermediate tutorials. Also, the more HTML5/JavaScript experience you, the better.