Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use NET::FTP to transfer files from a cgi script on a webserver to a ftp server for archiving. The end user will upload a PDF via the cgi script, then it will be sent to the ftp server. For beurocratic reasons these machines must be seperate, and I don't have direct control over the webserver.
The problem is that NET::FTP truncates every file I try to send this way. The file makes it intact to the webserver, but it is truncated when it arrives at the ftp server. Using standard unix ftp I have no problems, however I have not found a way to use anything other than NET::FTP in a perl script. ( scp won't work for anonymous xfers, which I need ). Ascii and binary modes have the same effect as both platforms are running *nix variants ( I've also tested it ).
The relevnant code is:$ftp->login('anonymous','submit@somesrvr.that.exists.edu'); $ftp->put("$prefix"."$f2"); $ftp->quit;
where "$prefix"."$f2" expands to the local file on the webserver, as the cgi script writes the uploaded file to a temp location ( named $prefix$f2 ) then sends that to the ftp server.
Could anyone point me in the right direction? I've been grepping and hitting google/monks/perl.com/lugs.. etc. for a while now with no luck.
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NET::FTP truncates files
by Dr. Mu (Hermit) on Aug 09, 2001 at 08:53 UTC | |
by Largos (Initiate) on Aug 09, 2001 at 10:58 UTC | |
|
Re: NET::FTP truncates files
by Agermain (Scribe) on Aug 09, 2001 at 00:57 UTC | |
by Largos (Initiate) on Aug 09, 2001 at 02:15 UTC | |
|
Re: NET::FTP truncates files
by lemming (Priest) on Aug 09, 2001 at 01:37 UTC | |
|
Re: NET::FTP truncates files
by princepawn (Parson) on Aug 09, 2001 at 02:21 UTC |