Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by megabrobro · Dec 21, 2017 at 08:48 PM · unity 5urldata storagedownloadable content

using WWW to download image from web. Not working on my own website, but does from other urls

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Larry-Dietz · Dec 22, 2017 at 01:17 AM

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

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image megabrobro · Dec 22, 2017 at 03:13 AM 0
Share

hi there , thanks for the information about Forbidden 403. I was getting that to start with when loading my image on the website in a web browser, but that seems to have gone. Additionally, I tried signing up 2 more domain names (megabrogames.co.uk and megabrogames.download) and each have different hostings , but I still have the problem with all of them :[

I will keep looking into it. I already asked the webhost live chat, but they said it was nothing to do with their service lol

avatar image megabrobro · Dec 22, 2017 at 03:14 AM 0
Share

@Larry-Dietz thanks very much for going as far as you did to check the pic. At least now I know for sure it is something to do with the websites hosts (i think lol)

avatar image megabrobro megabrobro · Dec 22, 2017 at 03:15 AM 0
Share

Coz all the permissions have been triple checked its 755 for folders, and 644 for files. I dont know really what else I can do, except maybe host my own ftp server or something

avatar image Larry-Dietz megabrobro · Dec 22, 2017 at 04:54 AM 0
Share

Are you using free hosting? I find that they can often be pretty restrictive. A lot of them block hot linking. I can tell you that my server is hosted by GoDaddy, and it was able to serve your image without any issues, into the RawImage UI component.

Show more comments
avatar image
0

Answer by megabrobro · Dec 22, 2017 at 04:38 PM

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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Larry-Dietz · Dec 22, 2017 at 08:45 PM 0
Share

You are very welcome. I am glad you found a solution to this :)

-Larry

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

143 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Download pdf file form url and saving in the specific folder in the mobile. 2 Answers

Video Player URL Stream Dropbox Video in Android Has Bug, but works fine in editor 0 Answers

Unity Down grade safety 5.6.1->5.6.0 0 Answers

Is there a way to make DLC in unity without assetbundle? 0 Answers

MongoDB C# authentication exception 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges