Unable read excel file

Forum to require and offer php jobs. Are you searching for php developers to make or complete your php script ? This place is for you.

Moderators: macek, egami, gesf

chandra
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Nov 25, 2011 7:34 pm

Unable read excel file

Postby chandra » Fri Nov 25, 2011 7:59 pm

Dear member,

I was made function to download a xls file. After user fill in this form, user will upload this form so that my application can read this form. But when I try to read the file, error was occur and said the file is not readable.

As information I use Spreadsheet_Excel_Reader class. I read the file name or temp file but both yield same error.

Please advice me a solution about this error.

And below is my scrip

Code: Select all

.
.
.

      $type       = $_FILES["file"]["type"];
      $name       = $_FILES["file"]["name"];
      $temp       = $_FILES["file"]["tmp_name"];
      
      if ($type=='application/vnd.ms-excel')
      {         
         $path   = SRV_ROOT.'voyage/temp/form.xls';      
         copy($temp,$path);         
         $data = new Spreadsheet_Excel_Reader();
         $data->setOutputEncoding('CP1251');
         $data->read($path);
         $page = 0;
         error_reporting(E_ALL ^ E_NOTICE);


.
.
.


Return to “PHP Jobs”

Who is online

Users browsing this forum: No registered users and 1 guest

cron