Hi there
I have this script attached to a RawImage file in my games UI
public class DownloadImage : MonoBehaviour {
string url = "http://megabrogames.rf.gd/pic.jpg";
//string url = "https://i.imgur.com/xBSyvRx.jpg";
IEnumerator Start () {
WWW www = new WWW(url);
yield return www;
GetComponent<RawImage>().texture = www.texture;
}
}
Both jpg files are the same. One I uploaded to Imgur , this works. The other is on my own website . The url to my website works fine, I have checked in on two computers and several browsers
All I get is the red question mark. But if I am to uncomment the other one instead it all works perfectly.
My problem is that I have hardcoded the url into the game, and I want to change the image each week. It has to be the same URL for that to work, but i think with Imgur it will auto assign whatever url it feels like.
thanks for any help
While I am not sure how to correct your problem, I do have some additional information that might point you in the right direction.
When trying to pull the image from your server, it is receiving the following response…
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
So I would guess that something in the configuration of your server is blocking the app from pulling the image.
I tried copying your image to my own server, and it worked fine from there.
May want to dig through your server configuration, and see if you can figure out why it is sending a forbidden response.
Hope this helps,
-Larry
It appears it was the free hosting blocking the linking of images.
My workaround for free (I dont want to pay a monthly fee of any kind for this hobby project) was to open an account with Github pages. They let me manage a website on their domain including the file names and it was very easy. It now all works.
Thanks for your help Larry