Open network file

Topics: User Forum
Apr 5, 2012 at 9:53 PM

Does anyone know if it is possible to open a network excel file with this library?  I've tried several different variations of the path and none seem to work.

\\\server\share\Public\Systems List.xls

\\server\share\Public\Systems List.xls

//server/share/Public/Systems List.xls

 

I've even tried it with the drive letter:

G:\Public\Systems List.xls

 

Here are my first few lines of code:

<?php
require_once '../phpexcel/Classes/PHPExcel.php';
$objReader = new PHPExcel_Reader_Excel5();
$objReader->setReadDataOnly(true);

$objPHPExcel = $objReader->load("\\\server\share\Public\Systems List.xls");
$objWorksheet = $objPHPExcel->getActiveSheet();

Thanks

Mike

Apr 11, 2012 at 2:51 PM

You would need to access it with Samba somehow. This works well for me: http://www.phpclasses.org/smb4php

Apr 17, 2012 at 12:15 PM

I had a similar problem and this worked for me...

$the_file = "\\\\192.168.1.10\\sjk\\sktest.xlsx";

The correct syntax is \\servername\sharename\filename but for each '\' there is another to escape it