2

I have uploaded images in Parse cloud. I'm using rest API to return the image URL to Javascript client (in Google Chrome). The image fails to load. When Inspected, the console in Chrome shows

GET http://files.parsetfss.com/bd4945df-f61a-4e6d-99cc-9a026fbadfa3/tfss-870a44af-fc02-4271-b365-aaeb6074cc10-dominos.png/ 403 (Forbidden).

But when I open the URL in browser, the image appears.

I tried returning the file object instead of the URL alone but I get the same issue with fileObject.url(). Below is the code for reference

In Javascript

Object contains a property named icon which has the URL of the parse file

<img src=' + returnedObject.icon + '/>

In Cloud Code

Temp is returned

var temp = {};
temp.prop1 = "something"
temp.icon = parseObject.get('icon').url();
2
  • 1
    What if you replace this <img src=' + returnedObject.icon + '/> with this: <img src="' + returnedObject.icon + '" /> Commented Jul 25, 2015 at 5:20
  • @Teddy, your suggestion worked. You may post it as an answer Commented Jul 26, 2015 at 8:48

2 Answers 2

1

What if you replace this

<img src=' + returnedObject.icon + '/>

with this:

<img src="' + returnedObject.icon + '" />

?

Sign up to request clarification or add additional context in comments.

Comments

1

The problem is with your URL. You have a trailing dash in the URL.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.