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:5
Author:mahesh patel
Date:2013-03-17 04:19:33
Update:2013-05-28 16:56:01
 

  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 );

  3. Re: Calling simplex.class.php with file in different directory   Reply  
Picture of Christian Zimmermann
Christian Zimmermann
2013-05-28 12:18:49 - In reply to message 2 from Sergey Shuchkin
Hello :)

Thanks for your Work, but i am unable to load the xlsx file. when the xlsx is in the same Directory like my .php it works fine but i i Change the path to an Network drive for example Z:\blabla\file.xlsx it doesent work anymore. Can you help me? Thank you.

include 'simplexlsx.class.php';
$xlsx = new SimpleXLSx('Z:\blabla\file.xlsx ');
list($num_cols, $num_rows) = $xlsx->dimension();
...

  4. Re: Calling simplex.class.php with file in different directory   Reply  
Picture of Christian Zimmermann
Christian Zimmermann
2013-05-28 13:18:40 - In reply to message 3 from Christian Zimmermann
also http://.../Daten.xlsx semm not to work :/

how can i fix that Problem?

  5. Re: Calling simplex.class.php with file in different directory   Reply  
Picture of Sergey Shuchkin
Sergey Shuchkin
2013-05-28 16:56:01 - In reply to message 4 from Christian Zimmermann
Christian, try copy file to local directory before parse