Download Images UE4.9

Hi there folks,
It seems that I got some problems with a project of mine.
I’m currently working on an online dating simulation (browser game, html5, mySQL database, jsonPlugin [thanks to stefander]). So there are quite much images to load over the net.

But it seems that the “downloadImage”-node was removed due to new update to 4.9.

I tought I could store the image inside the database… encode it to base64… decode it inside ue4 and convert it somehow to an UTexture2D… quite an overhead I know… but Im quite new to ue4… so I got no clue how to archive this.

If there is anybody who know a way to 1.) directly download images via URL, OR 2.) to convert a base64 decoded string to an UTexture2D that’d be reeeaally nice.

I’d be more than thankfull If anybody could help me out.

Hi , any luck downloading the Image? I am looking to do the same image downloading from MySQL, but not sure what is the best way to do it orwhat is the only way to do it…

Thanks, Diego.

i’ve just tested this and Download Image for HTML5 works

HOWEVER!!!

one of 2 things must be done:

  • the server MUST send back a response header with “access-control-allow-origin:*” (or something similar to give the browser permissions to use the file & and the request header MUST also be set to this “similar” value) – this assumes you have control of the “external” server to do that.
  • or, host the images from the SAME DOMAIN (i.e. from the same web server your game is hosted from) – this is the easiest solution

due to Cross-Origin Resource Sharing (CORS) checks (and this is a browser thing) it was designed to protect the web user from getting “tricked” from Cross-Site scripting (XSS) hacks. it’s good protection for users.

think of this as locking down your content and scripts.

it may be possible to write a <img src=“…”> work around for this – but that isn’t on the road map. duplicate the asset on your web server for the easiest solution.

The project took a huge change. Everything is now solved in php and psql. I just use ue4 for an async call of jsonRequest.

So UE4 request with JSON-data to a php-Script => The data is polled out of the database via Postgresql => the Imagedata is temporarily transfered to a secured /tmp folder => the absolute path of the image will transmit to UE4 => the JSON Plugin will recieve the nec. data i.e. (imagepaths, gamerelevant-stuff) => Then I use the DownloadImage Node (feed it with the absolute server path) the Engine is only used for displaying that stuff…

Thanks a lot, I will try it.