Reading images from an asset folder in web export

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Panagiotis Halatsako

I am trying to make a simple quiz game (godot v3.2.1 stable) with some jpeg photos located in res://photos/
I have used the following code to get the images to a var called movie_titles (it’s a movie quiz!):

func dir_contents(path):
	JavaScript.eval("console.log('reading from path:"+path+"')")
	var dir =
	if == OK:
		var file_name = dir.get_next()
		while file_name != "":
			if dir.current_is_dir():
				#print("Found directory: " + file_name)
				#print("Found file: " + (path+file_name).get_extension())
				if (path+file_name).get_extension() == "jpg":
			file_name = dir.get_next()
		print("An error occurred when trying to access the path.")
		JavaScript.eval("console.log('An error occurred when trying to access the path.')")

My problem is that when I export this to html5 I get that the size of the movie_titles is 0.

I get this both from the built in test webserver and in python3’s web server. Is there something I need to do to html5 export?

:bust_in_silhouette: Reply From: Panagiotis Halatsako

Actually this is answered before:

It seems that the jpeg/image files are moved into a special .import folder and the actual forlder has only jpg.import extensions. Looking at the above answer I was able to complete my solution and load dynamically what I wanted.