ftp cannot put full pathnames, cd to dir instead
[Digitiz.git] / digitiz-xfer
index e5b79d3..3fb0caf 100755 (executable)
@@ -223,12 +223,17 @@ sub docopy { #copies a file to the remote host
   _logmsg("copying $source_directory/$file to ".
           "$destination_host:$dest_file with $protocol");
 
+  #so close
+  if ( $protocol eq 'ftp' ) { #so close
+    $xfer->cwd(dirname($dest_file));
+    $dest_file = basename($dest_file);
+  }
   $xfer->put("$source_directory/$file", $dest_file);
 
   my $localsize = -s "$source_directory/$file";
   my $remotesize = $xfer->size($dest_file);
 
-  if ( $localsize == $remotesize ) {
+  if ( $localsize && ( $localsize == $remotesize ) ) {
     logsuccess($file);
     archive($file);
   } else {