'img/car.jpg' is a file on the server which the browser requests from your server when you assign the path to an <img>
element.
DirectoryEntry
and DirectoryReader
work on the client only.
What you need is that the server provides an API (e.g. JSON) that lets you request a list of files/directories from your server (e.g. of your img
directory).
If your server has directory listing enabled you could alternatively send a simple HTTP request with /img
as URL and parse the response.