【发布时间】:2016-01-23 00:08:37
【问题描述】:
我在业务网络上设置了一个网络服务器。我正在使用 php 创建一个文件,我想将它写入网络上的本地客户端共享文件夹。当我从客户端 ping 时,我得到了网络服务器的响应。当我从网络服务器 ping 时,我得到了客户端的响应。这是我的代码。我收到权限错误。有什么想法可能导致这种情况吗?路径是否正确?如何制定路径?
$fileName = "\\\\7PD01-2012.payday.local\\PTBurnJobs\\file.txt";
var_dump($fileName);
if (($myfile = fopen($fileName, "w+")) === false) { //open the file
//if unable to open throw exception
throw new RuntimeException("Could Not Open File Location.");
}
foreach($arr as $line){
fwrite($myfile, $line . PHP_EOL);
}
fclose($myfile);
在网络服务器上创建文件然后将其传输到客户端会更谨慎吗?我该怎么做?
【问题讨论】:
-
你在这方面有进展吗?
标签: php windows file ubuntu client