in reply to Re: Display DIR files and output in html to select a file
in thread Display DIR files and output in html to select a file

Ughh. Feel so silly. Thanks! So it does display as such: These are the files in /var/log/vista/stcr2tsvr/

stc-gblkcopy.log 20150208-dubr3psvr-backup.log vista-stc.log 20150209-dubr3psvr-backup.log 20150210-dubr3psvr-backup.log cconsole.log 20150207-dubr3psvr-backup.log
and they are hyperlinks. Just need to figure out why when I click a link it is looking for the file in the cgi-bin dir where it is not located. So clicking the hyperlink of the log file that is located in /var/log/vista/stcr2tsvr/ directs me to http://10.*.*.*:****/cgi-bin/20150207-dubr3psvr-backup.log. Is there a way to direct it to the proper location or do I need to set up an alias in the httpd.conf pointing to /var/log/vista/stcr2tsvr/

Replies are listed 'Best First'.
Re^3: Display DIR files and output in html to select a file
by vhaphisasset (Initiate) on Feb 24, 2015 at 22:06 UTC

    So this is the portion that I am referencing

    foreach my $file (@files) { print $list->p( $list->a({-href=>$file}, $file) );

    the href is looking for the correct file name just in the wrong DIR looking in cgi-bin. How would I say $list->a({-href=>$fileDir+$file}, So have the href look in the $fileDir and display the $file to read it. I want the href to include the correct DIR+File

      So, what's the problem? "$fileDir/$file". Or, if you want to do it right:
      use File::Spec::Functions; ... catfile($fileDir, $file) ...
      or even better, use glob instead of readdir...