欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

phpfreadbuffer問題

Here is a small code on how to read the folder and download all its files:

云州網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站設(shè)計(jì)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。創(chuàng)新互聯(lián)自2013年起到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)。

<?php
$host = 'localhost';$port = 22;$username = 'username';$password = 'password';$remoteDir = '/must/be/the/complete/folder/path';$localDir = '/can/be/the/relative/or/absolute/local/path';if (!function_exists("ssh3_connect"))
    die('Function ssh3_connect not found, you cannot use ssh3 here');if (!$connection = ssh3_connect($host, $port))
    die('Unable to connect');if (!ssh3_auth_password($connection, $username, $password))
    die('Unable to authenticate.');if (!$stream = ssh3_sftp($connection))
    die('Unable to create a stream.');if (!$dir = opendir("ssh3.sftp://{$stream}{$remoteDir}"))
    die('Could not open the directory');$files = array();while (false !== ($file = readdir($dir))){
    if ($file == "." || $file == "..")
        continue;
    $files[] = $file;}foreach ($files as $file){
    echo "Copying file: $file\n";
    if (!$remote = @fopen("ssh3.sftp://{$stream}/{$remoteDir}{$file}", 'r'))
    {
        echo "Unable to open remote file: $file\n";
        continue;
    }

    if (!$local = @fopen($localDir . $file, 'w'))
    {
        echo "Unable to create local file: $file\n";
        continue;
    }

    $read = 0;
    $filesize = filesize("ssh3.sftp://{$stream}/{$remoteDir}{$file}");
    while ($read < $filesize && ($buffer = fread($remote, $filesize - $read)))
    {
        $read += strlen($buffer);
        if (fwrite($local, $buffer) === FALSE)
        {
            echo "Unable to write to local file: $file\n";
            break;
        }
    }
    fclose($local);
    fclose($remote);}

You can also resume this code to (it will not copy directories):

while (false !== ($file = readdir($dirHandle))){
    if ($file == "." || $file == "..")
        continue;

    echo "Copying file: $file\n";
    if(!ssh3_scp_recv($connection, $remoteDir . $file, $localDir . $file))
        echo "Could not download: ", $remoteDir, $file, "\n";}

If you do not use the full path on the remote folder it will not work:

opendir("ssh3.sftp://{$stream}{$remoteDir}")

網(wǎng)頁名稱:phpfreadbuffer問題
文章路徑:http://aaarwkj.com/article0/jjheio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作外貿(mào)網(wǎng)站建設(shè)、微信公眾號(hào)、營銷型網(wǎng)站建設(shè)網(wǎng)站建設(shè)、定制網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管
国产一区二区视频在线| 国产美女极度色诱视频| 韩国专区福利一区二区| 青青草成人公开在线视频| 国产一区av剧情巨作| 青青草原天堂在线免费观看| 激情毛片av在线免费看| 九九99九九99九九精品在线观看| 婷婷久久香蕉毛片毛片| 日本一区二区不卡二区| 国产极品美女高潮抽搐| 女同亚洲一区二区三区| 91麻豆粉色视频在线| 中文字幕中文字幕乱码| 美国真人性做爰视频免费| 麻豆精品人妻中文在线| 亚洲成人av在线直播| 五月爱婷婷六月爱丁香色| 亚洲最色最黄大片在线视频| 麻豆国产av巨做国产剧情| 一区二区三区欧美久久| 国产成人av综合久久视色| 日本一区二区三区日本| 人妻伦理一区二区三区| 高潮少妇高潮少妇av| 中文字幕不卡一区在线| 激情五月,开心五月深情五月| 日韩亚洲天堂视频免费观看| 麻豆影片在线免费观看| 中文字幕精品一区二区介绍| 国产精品午夜视频免费观看| 国产黄色片网站在线观看| 未满十八禁在线观看免费| 国产精品女人毛片在线看| 禁止18黄色免费网站| 欧美成人精品在线观看| 日韩爱视频一区二区| 国产精品播放一区二区三区| 一区二区三区日本在线观看| 亚洲一区二区日韩综合久久| 日韩在线观看精品亚洲|