Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[opendir] Local directory and files?

Status
Not open for further replies.

Vebjorn

Technical User
Feb 3, 2004
13
NO
---
$path="images";
opendir(FP,"$path");
@innhold=readdir(FP);
closedir(FP);


foreach $dir (@innhold){
print "<img src='$path/$dir'>";
print "<br>\n";

}
---

This code opens the directory "images" and displays all the images in the directory.

The output of this code can be viewed at


Is it possible to make a similar script, which can display all the images in a local directory?


-Web
 
I'm assuming that you're wanting to open a user's local directory and not one on the web server? If so, that isn't possible using Perl, as it is a server side language and through websites does not transact with the client machine. (Websites are a disconnected solution where a request is made and answered to and communication is severed between each request.)

But on the bright side, there could be an answer for you using some type of Javascript solution.

- Rieekan
 
Yes, that was what I was thinking of.

Will it be possible if I install an Apache server on my computer? And then put the images I want to view into one specified directory?


-web
 
Sure, that would work to show the images on your computer via a web page. Alternately, you could just make the perl script write an HTML file which you could open separately instead.

- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top