Hi guys i am a CS student, i made a web application but i need a little help. I use a class to parse xls which is provided here
http://code.google.com/p/php-excel-reader/. Sometimes when I upload a .xls I get that the filename is not readable, when I run the application on localhost I have no problems. So I' ve checked for permissions and for the path but they are ok, its driving me insane because a get the error once and then if I refresh the page and try again, it works properly, some other times it will not work even if I refresh the page dozen of times. I use the following
Code: Select all
$tempFile = $_FILES['ufile']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . '/dea/uploads/';
//$targetPath = 'uploads/';
//echo "$targetPath<br/>";
$targetFile = str_replace('//','/',$targetPath) . $_FILES['ufile']['name'];
//echo "$targetFile<br/>";
move_uploaded_file($tempFile,$targetFile);
chmod($targetFile, 0755);
//Create new instance
$excel = new Spreadsheet_Excel_Reader();
//$excel->setOutputEncoding('CP1251');
$excel->read($targetFile);
If anyone had the same problem or can assist me it would be greatly appreciated, thanks in advance!