尝试在远程服务器上下载文件并将其保存到本地子目录.
以下代码似乎适用于小文件,<1MB,但较大的文件只是超时,甚至没有开始下载.
<?php
$source = "http://someurl.com/afile.zip";
$destination = "/asubfolder/afile.zip";
$data = file_get_contents($source);
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
?>
Run Code Online (Sandbox Code Playgroud)
有关如何不间断下载较大文件的任何建议?
我正在使用VSCode作为Windows 10中的编辑器进行Electron教程。
我的main.js文件仅包含一行:console.log('main!');
当我在VSCode中打开终端视图(Ctrl +`)并键入“ npm start”时,console.log命令不会显示。
但是,当我打开cmd.exe并运行“ npm start”时,“ main”!出现console.log命令。
我尝试将VSCode的默认终端更改为cmd.exe而不是powershell,但结果相同。
如何使我的console.log命令出现在VSCode终端窗口中?