cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
unless ($suppressftp) { print "FTP starting...\n"; my $ftp = Net::FTP->new("ftp.mysite.com", Debug => 0) or die "Cann +ot connect to ftp.mysite.com: $!"; $ftp->login("uid",'password') or die "Cannot login ", $ftp->messag +e; $ftp->binary; $ftp->cwd("mydir") or die "Cannot change working directory ", $ftp +->message; $ftp->put("$filename\.php") or die "Can't put $filename\.php ", $f +tp->message; $ftp->cwd("gfx") or die "Cannot change working directory ", $ftp-> +message; for my $file ('g_f.png','g_m.png','g_p.png','g_r.png','g_t.png','s +eries_1.png','series_2.png') { print "...writing $file\n"; $ftp->put("gfx/$file") or die "Can't put gfx/$date$file ", $ftp->m +essage; } $ftp->quit; }
Everything uploads fine, but when I try to open the php file with my browser I get a php parse error ("extra $"). If I re-upload the same php file using an FTP client I have (WS-FTP) then the file opens fine.
I've tried uploading the php file in both text and binary mode, same result. Obviously Net-FTP is doing something bad to the php file when it uploads it. Has anyone had this problem or know how to fix?
thanks.....Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net-FTP corrupting php file
by davidrw (Prior) on May 23, 2005 at 13:45 UTC | |
by cormanaz (Deacon) on May 23, 2005 at 21:54 UTC |