in reply to Re: File::Copy across a Network
in thread File::Copy across a Network

That's fantastic. Thanks v much. Unfortunately I don't know how to call this type of script from the rest of my Perl stuff. Can you give me any tips on this? It also seems to crash unless I unclude:

print "Content-type:text/html\n\n";

Replies are listed 'Best First'.
Re: Re: Re: File::Copy across a Network
by tachyon (Chancellor) on May 04, 2002 at 05:40 UTC

    Sorry code was bare bones (as well as untested :-). With CGI you need a valid header which I neglected with the upload sub. To call it from perl use LWP which is a perl HTTP client (effectively a very basic browser). There are a ton of LWP examples on this site, use Super Search. To call it from any client machine just use a browser and browse to the script on the server.

    sub upload { if ($q->upload( 'upload_file', $target )) { print $q->header, "Uploaded ", $q->param('upload'), "OK\n"; } else { print $q->header, "Oops!\n"; } }

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print