Login   Register  
PHP Classes
elePHPant
Icontem

Calling simplex.class.php with file in different directory

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Simple XLSX  >  All threads  >  Calling simplex.class.php with file in different directory  >  (Un) Subscribe thread alerts  
Subject:Calling simplex.class.php with file in different directory
Summary:I am having trouble loading a file in a subdirectoy.
Messages:2
Author:mahesh patel
Date:2013-03-17 04:19:33
Update:2013-03-17 11:03:25
 

  1. Calling simplex.class.php with file in different directory   Reply  
Picture of mahesh patel
mahesh patel
2013-03-17 04:19:33
This should be a very simple problem, but I am unable to load a .xlsx file down the directory tree by one. It works for my other function calls.

$xlsx = new SimpleXLS("filetoload"); //works fine

but
$xlsx = new SimpleXLS("./docs/filetoload");
or
$xlsx = new SimpleXLS("docs/filetoload");


do not. What am I missing?

  2. Re: Calling simplex.class.php with file in different directory   Reply  
Picture of Sergey Shuchkin
Sergey Shuchkin
2013-03-17 11:03:25 - In reply to message 1 from mahesh patel
1) try
echo getcwd();
---- get current work directory and correct path to your xlsx file

or

2) use abs path
$filename = dirname(__FILE__).'/docs/mahesh_try_google_first.xlsx';
$xlsx = new SimpleXLSX( $filename );