unable to read file from network folder \\myfolder\fi\a.xx
Moderator: General Moderators
-
parvez mahmud
- Forum Newbie
- Posts: 2
- Joined: Thu May 29, 2008 5:57 am
unable to read file from network folder \\myfolder\fi\a.xx
I have written a php script that read excel file ,write something on it and save as the file using a specific format.The script work fine in local machine.But when tried to the excel file from network folder for instance \\myroot\\template\\a.xls the scrips fails.I've used COM to access excel file.Can anyone have any idea.Plesae help me.I need solution badly. 
- Jaxolotl
- Forum Contributor
- Posts: 137
- Joined: Mon Nov 13, 2006 4:19 am
- Location: Argentina and Italy
Re: unable to read file from network folder \\myfolder\fi\a.xx
It's hard to find the solution with no code posted
-
parvez mahmud
- Forum Newbie
- Posts: 2
- Joined: Thu May 29, 2008 5:57 am
Re: unable to read file from network folder \\myfolder\fi\a.xx
class ExcelWrite{
private $excel;
private $wkb;
private $sheet;
private $cell;
function OpenFile($fname){
$this->excel = new COM("excel.application");
//Keep Excel invisible
$this->excel->Visible = 1;
//Create a new workbook
//$wkb = $excel->Workbooks->Add();
$this->excel->DisplayAlerts = 0;
$this->wkb= $this->excel->Workbooks->Open($fname);
$this->sheet = $this->wkb->Worksheets(1);
$this->sheet->activate;
}
}
WriteToExcel($input,$output){
$extem=new ExcelWrite();
$extem->OpenFile($input)
}
$tempfilepath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\template.xls";
$exportfileapath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\Export\\" ;
WriteToExcel($tempfilepath,$exportfileapath);
No Problem.The scripts open the excel file.
But if
$tempfilepath="\\\\mynetwork\\template.xls;
$exportfileapath="mynetwork\\Export\\" ;
Then the script can't read the file from network.
Is there any solution for this.
private $excel;
private $wkb;
private $sheet;
private $cell;
function OpenFile($fname){
$this->excel = new COM("excel.application");
//Keep Excel invisible
$this->excel->Visible = 1;
//Create a new workbook
//$wkb = $excel->Workbooks->Add();
$this->excel->DisplayAlerts = 0;
$this->wkb= $this->excel->Workbooks->Open($fname);
$this->sheet = $this->wkb->Worksheets(1);
$this->sheet->activate;
}
}
WriteToExcel($input,$output){
$extem=new ExcelWrite();
$extem->OpenFile($input)
}
$tempfilepath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\template.xls";
$exportfileapath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\Export\\" ;
WriteToExcel($tempfilepath,$exportfileapath);
No Problem.The scripts open the excel file.
But if
$tempfilepath="\\\\mynetwork\\template.xls;
$exportfileapath="mynetwork\\Export\\" ;
Then the script can't read the file from network.
Is there any solution for this.