Fix missing migration
This commit is contained in:
parent
6b5fac432f
commit
07f9541efd
@ -218,6 +218,35 @@ function dol_ftp_get($connect_id, $file, $newsection)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a FTP file
|
||||
*
|
||||
* @param resource $connect_id Connection handler
|
||||
* @param string $file File
|
||||
* @param string $newsection $newsection
|
||||
* @return result
|
||||
*/
|
||||
function dol_ftp_put($connect_id, $file, $newsection)
|
||||
{
|
||||
|
||||
global $conf;
|
||||
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
|
||||
}
|
||||
|
||||
// Remote file
|
||||
$filename = $file;
|
||||
$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
|
||||
$newremotefileiso = utf8_decode($remotefile);
|
||||
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
return fopen('ssh2.sftp://'.intval($connect_id).$newremotefileiso, 'r');
|
||||
} else {
|
||||
return ftp_put($connect_id, $localfile, $newremotefileiso, FTP_BINARY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove FTP directory
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user