1
This commit is contained in:
@@ -251,7 +251,7 @@ function getAuthor($article) {
|
||||
}
|
||||
|
||||
|
||||
function pushSFTPForScopus($file,$pdf_file)
|
||||
function pushSFTPForScopus($file,$pdf_file,$stage_info)
|
||||
{
|
||||
$host = 'sftp-opsbank2.elsevier.com';
|
||||
$port = 22; // SFTP 默认端口号
|
||||
@@ -270,21 +270,27 @@ function pushSFTPForScopus($file,$pdf_file)
|
||||
// print_r($fileList);
|
||||
|
||||
// 上传文件到 SFTP 服务器
|
||||
// if($stage_info !=null){
|
||||
// $bb = '/data/incoming/tmr/'.$stage_info['stage_year']."tmr-".$stage_info['stage_vol']."-".$stage_info['stage_no']."/";
|
||||
// }else{
|
||||
$bb = '/data/incoming/tmr/';
|
||||
// }
|
||||
$localFile = ROOT_PATH."public/articleXML/".$file;
|
||||
$remoteFile = '/data/incoming/tmr/'.$file;
|
||||
$remoteFile = $bb.$stage_info['stage_year']."v".$stage_info['stage_vol']."n".$stage_info['stage_no']."-".$file;
|
||||
|
||||
$res = $sftp->put($remoteFile, $localFile, SFTP::SOURCE_LOCAL_FILE);
|
||||
|
||||
//上传pdf
|
||||
$localPdf = ROOT_PATH."public/articlePDF/".$pdf_file;
|
||||
|
||||
$remoteFilePdf = "/data/incoming/tmr/".str_replace(".xml",".pdf",$file);
|
||||
$remoteFilePdf = $bb.$stage_info['stage_year']."v".$stage_info['stage_vol']."n".$stage_info['stage_no']."-".str_replace(".xml",".pdf",$file);
|
||||
|
||||
$res1 = $sftp->put($remoteFilePdf,$localPdf,SFTP::SOURCE_LOCAL_FILE);
|
||||
if ($res&$res1) {
|
||||
echo "文件上传成功!";
|
||||
} else {
|
||||
var_dump($sftp);
|
||||
// echo $sftp->getErrors();
|
||||
var_dump($sftp->getErrors());
|
||||
// return $sftp;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user