无法在网络中保存文件

时间:2014-12-12 05:10:59

标签: php network-programming phpexcel

当我在本地计算机中保存时,这是有效的,但是当我尝试在网络中保存时,它会给我一个错误。

Warning: fopen(\\ipcsvs001\c$\myfolder\12122014.xls) [function.fopen]: failed to open stream: Permission denied in C:\wamp\www\receivables\PHPExcel\Shared\OLE\PPS\Root.php on line 90

Fatal error: Uncaught exception 'PHPExcel_Writer_Exception' with message 'Can't open \\ipcsvs001\c$\myfolder\12122014.xls. It may be in use or protected.' in C:\wamp\www\receivables\PHPExcel\Shared\OLE\PPS\Root.php:93 Stack trace: #0 C:\wamp\www\receivables\PHPExcel\Writer\Excel5.php(226): PHPExcel_Shared_OLE_PPS_Root->save('\\ipcsvs001\c...') #1 C:\wamp\www\receivables\index.php(241): PHPExcel_Writer_Excel5->save('\\ipcsvs001\c...') #2 {main} thrown in C:\wamp\www\receivables\PHPExcel\Shared\OLE\PPS\Root.php on line 93  

我的代码就像这样

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); 
$objWriter->save('\\\ipcsvs001\c$\myfolder\\'.date('mdY').'.xls');

注意:我在此文件夹中拥有完全控制权限" \ ipcsvs001 \ c $ \ myfolder \"

帮助人员的TIA。

2 个答案:

答案 0 :(得分:0)

您的网络服务器似乎没有适当的权限来写入该文件。

答案 1 :(得分:0)

如果您的ipcsvs001是主php的子目录,请尝试如下

fopen('..ipcsvs001/c$/myfolder/12122014.xls', 'r'); 

试试这些 - http://php.net/manual/en/features.remote-files.php