Hi group!
Little bit of background. I made a perl cgi that scans a directory for files and auto
generates a html page with hyperlinks to download whatever files are in the directory.
I don't
know if there's an easier way to do this than what I did (built it from scratch) but
I'm doing this to learn Perl, not to make things easy. I had this working locally
through
localhost, using the full path to the files, but it won't work if someone tries to
access it remotely. Anyway, on to the problem.
I'm having trouble writting my absolute path for a link to a .zip file in a cgi script.
Here's my code.
while($i < ($#filelist))
{
if ((@filelist[$i] ne '.') && (@filelist[$i] ne '..'))
{
print "<A HREF =
\"ftp\\public\\downloads\\assortedfiles\\@filelist[$i]\">@filelist[$i]</A>";
print "<BR>\n";
}
$i++;
}
The problem being, that because this file is in my CGI bin, I need to back track to
the parent directory a few times and then follow another branch of the directory
structure back out to the ftp directory..
I can't add a C:\ to the front of it because then it can only be accessed locally.
I'm thinking I could use something like
\\..\\..\\ftp\\public\\downloads\\assortedfiles\\
To backtrack like in Unix, but it doesn't work like I thought it would. I'm using
Windows 98 and Apache web server to do this in. So my cgi-bin is in the standard
c:\program files\apache group\apache\cgi-bin\
My full path to ftp is:
c:\ftp\public\downloads\assortedfiles\
I don't know, I may be on the right track with the Unix style .. and perhaps just
messed up with my quoting in the script. Or, I'm completely lost.
Can someone help me?
-Dave