in reply to Re^3: Perl cgi script for directory listing and file downloading!! Problem: Unable to download the file
in thread Perl cgi script for directory listing and file downloading!! Problem: Unable to download the file

ok, but what will be the path for opendir, will it be my $dir='/www/Documents' or will it be $dir='C:/wamp/www/Documents ...? What is the default directory if i dont give any path?
  • Comment on Re^4: Perl cgi script for directory listing and file downloading!! Problem: Unable to download the file
  • Select or Download Code

Replies are listed 'Best First'.
Re^5: Perl cgi script for directory listing and file downloading!! Problem: Unable to download the file
by Corion (Patriarch) on Nov 05, 2014 at 12:13 UTC

    There is no default. You should always give an absolute path.

      Ok, I have successfuly opened a file in browser directly using this URL: http://localhost:8080/Documents/dbschema.pdf now in script, should i use this? opendir(DIR,'http://localhost:8080/Documents/')

      ?

        You still need to learn about the difference between access via HTTP and local access. HTTP uses http:// URLs. Local access uses file paths like C:\www\Documents\. readdir does local access. The web browser does HTTP access.