梦里花落0921
我设法通过本文中的 php chunk upload 来完成此操作: https://artisansweb.net/how-to-implement-chunk-upload-in-php/php中分块上传的源代码:$tmpfile = 存储路径(路径); $orig_file_size = filesize($tmpfile); $chunk_size = 256; // chunk in bytes $upload_start = 0; $handle = fopen($tmpfile, "rb"); $fp = fopen('ftp://USERNAME:PASSWORD@HOST:21//TARGETDIR/FILENAME', 'w'); while($upload_start < $orig_file_size) { $contents = fread($handle, $chunk_size); fwrite($fp, $contents); $upload_start += strlen($contents); fseek($handle, $upload_start); } fclose($handle); fclose($fp);