Phaser3 load images from folder - phaser-framework

Is it possible to loop through folder to load all possible images inside this folder (in Phaser I need to this.load.image and also afterwards add loaded images)?
This is necessary for Phaser3 game. It is hosted on Apache.
I think that it could be a problem from security reasons or there is some approach?

I searched through Phaser documentation but I didn't find anything that would do the job, Phaser does not seems to implement a filesystem by itself. So you could use this answer and if it doesn't work you should refer to Apache filesystem.
The goal here is to store all the images contained in your assets folder in an list (recursively? if you have some nested folders) then loop through that list calling this.load.image with each image directory.
If you manage to make it work please post the code : )

Related

How do I load an Android Studio resource file in so I can copy it?

I'm creating an app which has various default icons. These are stored in the 'drawables' folder, as png files. I want to be able to copy these across to internal storage when the user installs the app. I have the names of the drawables stored in the database (see my question from yesterday, here).
I'm not sure how to actually read the drawable in as a file, though. So, let's say I have a drawable called 'icon.png'. I need to open that and copy it across to the internal storage - but I'm not sure what the file path should be or how to go about it. I've been going round in circles in the documentation and got myself really confused!
Can anyone point me in the right direction?

How persistent is data I put on my Azure WebApp via FTP?

I've been searching around and can't find any clear answers to this. I need a small amount of data - talking kilobytes, probably not ever reaching megabyte range - available as a file on my Azure instance, outside the web app itself, for a web job to work with. I won't get into why this is necessary, but it is (alternatives have been explored), and the question is now where to put those files. The obvious answer seems to be to connect to the FTP, create a directory, plop them there and work with them there.
I did a quick test and I'm able to create a "downloads" directory within the "data" directory, drop some files in it, and work with them there. It works great for this very small, simple need that I have.
How long will that data stay there? Is that directory purged at any point automatically by the servers? Is that directory part of any backups that are maintained? How "safe" is something I manually put outside the wwwroot folder?
It will never be purged. The only folder that can get purged is the %TEMP% folder. All other folders that you have write access to will be persisted forever.

Path of newly added image files in IBM Connections

I have been trying to customize IBM Connections UI and have been able to insert and execute code in header.jsp thanks to the material available on the web.
The problem is if I add a new image file under the themes directory in <IBM_CONNECTIONS>\data\shared\customization\themes\images, how do I reference this image in header.jsp? Surely I cannot use an absolute path here which is <IBM_CONNECTIONS>/connections/resources/web/com.ibm.lconn.core.styles.oneui3/images/myimage.png.
Similarly I would like to add a new JavaScript, but I am not able to figure out how to give its relative path in header.jsp.
The <CONNECTIONS_CUSTOMIZATION_PATH>/themes directory should only be used to override images referenced by existing stylesheets, or add new images for custom stylesheets. If all you need is to display an image, the recommended location is <CONNECTIONS_CUSTOMIZATION_PATH>/common/images (create subdirectories if necessary). The image will be available under every application's context root, e.g. /files/images/myimage.png
claudiopro, your solution works with /files/images/myimage.png and /profiles/images/myimage.png and so on. But what about main /homepage/
The url /homepage/images/myimage.png is not working.
Do you know how to avoid that?
Do you also know where the solution you provided is documented in IBM Knowledge Center?
In documentation of Connections 5.0 there are few pages about images and CSS custiomizations but some of those solutions are not even working, some are in contraty with each other...

Trying to move Drupal install TO subdirectory

Okay, so I've searched everywhere and while I can find plenty of stuff about moving a Drupal install out of a subdirectory I can't find anything on moving one into a subdirectory. I've recently taken over this project and it was developed without me so I've been landed in it here.
The problem is that the site was developed in the root of a dev server and I now have someone who wants it in a subdir. I've changed the base url in the htaccess and I've tried manually changing references in the CSS and DB but I can't be sure I've caught everything (modules etc).
What I want to know is, is there a way to force every link relative to the root to be relative to root/example instead. Basically everything that was once at www.example.com is now at www.example.com/subdirectory.
Thanks.
There's two pieces to this. The first you've already done: configuring htaccess to set a base url that includes the subdirectory.
Unfortunately, you may have quite a few references in the node content (especially embedded images) that will stop working.
A relatively simple solution to this would be to include a <base href="foo.com/dir" /> tag in your site theme, but this isn't a great fix in the long term.
You can try modifying your database directly, through queries such as the following (use with care, backup your database ahead of time, etc):
UPDATE field_revision_body SET body_value = REPLACE(body_value, 'devdomain.com', 'proddomain.com/subdir') (add http:// into those queries)
You may also need to update the paths in your files table to reflect the new locations on disk, especially if you're using multisite.
Alternately, have you considered using the Backup & Migrate module to move content from the dev server to a new install at the new instance?

Organisation / Management of files on a web server

I'm looking for a good word to describe the placement of files in a directory.
For instance, putting all files that are includes within an "includes" directory.
Putting images into an "images" directory.
I'm sure there is a right word for it, its just not coming to me today :-(
I usually call this kind of information directory structure or folder structure. If you're attempting to offer a guide to best practice, you could prefix these phrases with 'suggested'...

Resources