Re: Help with Net::ftp not downloading



Ed Jay wrote:
J. Gleixner wrote:

Ed Jay wrote:
J. Gleixner wrote:

Ed Jay wrote:
I'm still a novice at Perl. I'm trying to develop a simple script to
download a set of files from my server to my local drive. Although I'm not
getting any error messages, the script isn't performing. Help, please!

(BTW, using this script I have been able to change and delete file names
on the server, so I know I'm properly logged in.)
[...]
chdir($localDir);
What if that fails?

Hammer meet nail! I added the error message trap, an lo, I get an error
message saying it can't change the local directory. Doesn't tell me why,
only what the path is on the server.
[...]

If you die with the reason, which is set in $!, you'll usually
get a pretty good explanation why it failed.

chdir( $localDir ) or die "Can't cd to $localDir: $!";

Without the CGI module installed, I get no error message. The script just
dies at the cd directive. With the CGI module installed and fatals to the
screen, after setting $localDir = C:\, I receive the error message,
chdir( $localDir ) or die "Can't cd to $localDir: $!"; I'm sure that must
be telling, but I can't fathom what it's telling me...I do have a drive C.


Hu? That looks like it's not executing the script. You shouldn't
see your code, in the browser. If you're running it via your
Web server, then 'use CGI' will help, otherwise you'll have
to print the header and HTML yourself.

Maybe the output is in your Web server's error log?

When in doubt, simplify the code to exactly what you're
trying to test.

use CGI qw(:standard);
# without the next line, die output will be found in your
# server's error log. Use this only when debugging.
use CGI::Carp qw(fatalsToBrowser);
use strict;

my $localDir = 'C:/somedir'; #change that to the appropriate location

print header,
"Changing directory to $localDir.<br>";

chdir( $localDir ) or die "Can't cd to $localDir: $!";

print "Change to $localDir successful.<br>";
.



Relevant Pages

  • Re: How do I insert a cgi script into Publisher page?
    ... If your ISP supports cgi and has a form handling program then a form created ... You must tell the server what e mail address you want the form results sent ... any where else you so desire or an auto redirect script with a delay. ... link to your host and specifically where on the host website it gives you ...
    (microsoft.public.publisher.webdesign)
  • Re: How do I insert a cgi script into Publisher page?
    ... If your ISP supports cgi and has a form handling program then a form created in publisher will function using FTP upload rather than front page server extensions to upload the pages. ... The thank you page may have a link back to the page where you came from or any where else you so desire or an auto redirect script with a delay. ... Also provide us a link to your host and specifically where on the host website it gives you the instructions for using the forms program in the cgi folder. ...
    (microsoft.public.publisher.webdesign)
  • Re: Apache: limiting the execution place
    ... They want it so users can't use FTP, shell, or a CGI or PHP script to view, ... other users via shell, FTP, web server processes (such as PHP or CGI ...
    (Security-Basics)
  • Re: Simple script execution problems (newbie)
    ... my $query= new CGI; ... Internal Server Error 500 and the error log reports "Premature end of script ... Permission denied", "Premature end of script headers: ...
    (comp.lang.perl.misc)
  • Re: How do I insert a cgi script into Publisher page?
    ... is not where I host my website. ... If your ISP supports cgi and has a form handling program then a form ... You must tell the server what e mail address you want the form results ... any where else you so desire or an auto redirect script with a delay. ...
    (microsoft.public.publisher.webdesign)