Image from database not showing

This forum contains topics that were moved from Get Satisfaction
Arjang Raoufinia
Posts: 0
Joined: Tue Sep 02, 2014 1:58 pm

Image from database not showing

Post by Arjang Raoufinia »

I have uploaded an image to the database, I query the line of database and database returns all the values correcly, even the image URL that I have in a label. However, eventhough I have mapped the image to image asset correctly, the image does not show. The URL for the broken image shows:

http://appery.io/app/view/eae6035a-46...

which is correct, for the image 955372bc-9259-464e-9faf-64895b156aed.justlogo.jpg

What am I doning wrong?

Arjang Raoufinia
Posts: 0
Joined: Tue Sep 02, 2014 1:58 pm

Image from database not showing

Post by Arjang Raoufinia »

From Database, I can click on the link for the image and I can download it, so I know the image is properly stored:

https://appery.io/bksrv/rest/1/admin/...

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

Image from database not showing

Post by Yurii Orishchuk »

Arjang Raoufinia
Posts: 0
Joined: Tue Sep 02, 2014 1:58 pm

Image from database not showing

Post by Arjang Raoufinia »

Hi,
I know my links are correct on the query. I have attached two images. I am getting the vendor_name from saved local variable and show the response as mapped. When I run the app, I see the vendor query execute correctly, I can see the vendor name also, I created a label for the URL of the image map and that shows the URL, but the image still is broke. Do I need to do any type of Javascripting beyond simple mapping for the image to show?

Image Image

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

Image from database not showing

Post by Yurii Orishchuk »

Hi Arjang,

I see you link "fileName" to image component asset. It's not correct. Because fileName is not a URL. See details: http://prntscr.com/4n8d4x/direct

If you have file name in your "fileName" field you should convert it to URL.

So here is solution:

1 Click "Add JS" for link to image component asset. http://prntscr.com/4n8dn0/direct

2 JS editor will appear.

3 Populate it with following code:

pre

//Note: please replace "[databaseID]" with your DB id.
var urlToSave = "https://api.appery.io/rest/1/db/files/[databaseID]/" + value;
return urlToSave;

/pre

Also if you can not manage to fix this problem please provide us your app public link and describe steps to reproduce the issue.

Regards

Arjang Raoufinia
Posts: 0
Joined: Tue Sep 02, 2014 1:58 pm

Image from database not showing

Post by Arjang Raoufinia »

Yurii : You are a genius!

Problem solved! Thanks,

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Image from database not showing

Post by EJLD »

Hi There,
I am querying for images from appery DB.
all images .jpg show well on browser views, and my android but not on my iOS.
it might come from the fact the original file is a artwork (vector) exported to .jpg.
see att'd. any idea how to format ?
thks in advance,
Eric

Image

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Image from database not showing

Post by Illya Stepanov »

Hi Eric,

I'm not sure, you're showing images from Android device and it doesn't show in iOS -- could you please provide a file example of this images?

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Image from database not showing

Post by EJLD »

Hi, thks for your prompt feedback.
all .jpg or .png photographs hv no problem to show up on both OS.
however, here att'd is the file type which doesn't show up in iOS but shows up in Android. this file type was created with a vector graphic app. then exported to .jpg. any idea why it doesn t show up on iOS ?
thk you in advance
Eric

Image

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

Image from database not showing

Post by Yurii Orishchuk »

Hi Eric,

It's hard to say what is wrong with this image.

So please give us your app public link and describe steps how we can test this problem in your app.

Regards.

Post Reply