[resolved] [closed] Excel_reader 2 - cannot read file (4 posts)

  1. bngaard
    Posted 2 years ago #


    I'm using excel_reader2 to get some data from excel-sheets. I've tested the script online outside of WP and it works flawless. However, when I embed the code into WP, it suddenly cannot read my excel-file.

    I know the path is correct and I also checked using a direct static url for the file. I keeps saying the file cannot be read.

    Does anyone have an idea of why the file can be read just fine outside WP, but not now? Its the same file and the same code...

    The code im using:

    require ("excel_reader2.php");
    $data = new Spreadsheet_Excel_Reader("http://neys.dk//beta/wp-content/DK_Jylland.xls");
    $container = array();
    for($j = 1; $j < $data->rowcount(); ++$j){
    $firma = $data->val($j, 'B');
    $id = $firma;
    $adresse = $data->val($j, 'C');
    $by = $data->val($j, 'E');

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  2. bngaard
    Posted 2 years ago #

    Never mind... solved it by
    $arquivo = 'example';

    $data = new Spreadsheet_Excel_Reader( ABSPATH . '/wp-content/themes/default/' . $arquivo . '.xls');

  3. bibhuwork
    Posted 2 years ago #

    i'm new to this blog and not getting how to post my quarry here .
    Please help me out i have certain quarry to be answered.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    @bibhuwork: If you require assistance then, as per the Forum Welcome, please post your own topic.

    This 4 month old topic has been resolved & references an old version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic