![]() |
![]() ![]() |
![]() |
joeseppe69 |
![]()
Post
#1
|
Group: Members Posts: 4 Joined: 15-August 19 Member No.: 26,958 ![]() |
Is there a way to have a slideshow of all the photos uploaded into a specific folder?
I can create a simple slideshow in HTML but I would need to list each of the photo file names within the code. If possible, I would rather the code be static and simply look to a specific folder where all the photos are stored and create the slideshow for all those images. Like that, if I wanted to change the photos in said folder, refreshing the page will the make the slideshow with the new photos and the core HTML code does not need to be edited. |
CharlesEF |
![]()
Post
#2
|
Programming Fanatic ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 ![]() |
In Javascript, No. But it can be done server side. (PHP, ASP, ...)
You can use server side code to generate a list of all files in the folder, encode it as JSON and send it to the client (which Javascript can then use). This post has been edited by CharlesEF: Aug 15 2019, 01:24 PM |
Christian J |
![]()
Post
#3
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 ![]() |
|
joeseppe69 |
![]()
Post
#4
|
Group: Members Posts: 4 Joined: 15-August 19 Member No.: 26,958 ![]() |
Never used PHP or ASP before.
I am just trying to create a simple dashboard for school Reception area. Just using HTML to layout the screen and content, without actually having a web server. Any advice on best way to proceed. |
Christian J |
![]()
Post
#5
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 ![]() |
Will the finished page be run from a web server? You'd need one in order to run server-side scripts. But it's not possible for (client-side) javascript to view the files of the client computer, for security reasons.
Maybe there are Windows programs that can generate a list of files as well (and then you'd just manually copy that list to the slideshow script code). |
pandy |
![]()
Post
#6
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 ![]() |
Maybe there are Windows programs that can generate a list of files as well (and then you'd just manually copy that list to the slideshow script code). Some text editors even. ![]() Or, available on every Windows PC. Bring up a command prompt and in the directory in question and type... CODE dir /b /a-d Or if you want to pipe the list to a file... CODE dir /b /a-d > list.txt The list may include the name of the text file too. |
joeseppe69 |
![]()
Post
#7
|
Group: Members Posts: 4 Joined: 15-August 19 Member No.: 26,958 ![]() |
Will the finished page be run from a web server? You'd need one in order to run server-side scripts. But it's not possible for (client-side) javascript to view the files of the client computer, for security reasons My idea was to have the HTML page running on a PC connected to a large screen in the entrance area of the building. It is a Windows machine so I could install IIS web server and point to localhost. Do I still need PHP or just JavaScript? |
pandy |
![]()
Post
#8
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 ![]() |
Yes. You need something server side, not necessarily PHP. Unless you generate the file list beforehand as Christian suggested. But that's not a good idea if the images are going to change over time since you would have to update the the list each time you added or removed images. If they won't change or change very rarely it could work.
Note that if you go the server side way you also need to install the programming language you want to use, e.g. PHP. At least if you choose Apache. With IIS I don't know. I think it comes with ASP, but I'm not sure what it can do. |
joeseppe69 |
![]()
Post
#9
|
Group: Members Posts: 4 Joined: 15-August 19 Member No.: 26,958 ![]() |
I’ve not done anything with Apache or PHP before, may need to be a longer term project.
Thanks for replying. |
pandy |
![]()
Post
#10
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 ![]() |
Well, if you aren't going to change pictures very often there's always the other option. Nothing wrong with static pages.
|
Christian J |
![]()
Post
#11
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 ![]() |
|
pandy |
![]()
Post
#12
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 ![]() |
Several programs in a bundled package are still several programs.
![]() |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 26th April 2024 - 09:06 AM |