#!/usr/bin/perl
use strict ;
use warnings ;
use CGI ;
use Net::FTP;
my $cgi = CGI->new();
...
my $file_name = $cgi->param( 'doc' ) || '';
$cgi->upload( 'doc_upload' );
# Can I alter where the file is temporally written here?
my $tmp_file = $cgi->tmpFileName( $file_name );
####
warn qq{rename ("$tmp_file", "temp/$file_renamed");\n};
if (!rename("$tmp_file", "temp/$file_renamed" )) {
warn $!, "\n";
}
chmod 0664, "tmp/$file_renamed";
# Error:
#Cannot open Local file doc1.txt: No such file or directory
####
rename ("", doc1.txt");
####
...
#my $put_file = $ftp->put("$file_renamed") or die "Cannot put file ", $ftp->message;
...
Error : Cannot put file The system cannot find the file specified.