Luyenkim.Net!

...where your idea grows!

 
  • Decrease font size
  • Default font size
  • Increase font size
Trang chủ arrow Forum arrow Mạng Luyenkim.NET arrow Tin từ các diễn đàn về Vật liệu
Luyện kim
Trả lời: Không thể đọc được file, sau khi đã upload thành công (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Trả lời: Không thể đọc được file, sau khi đã upload thành công
#838
trucnhi
(User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Không thể đọc được file, sau khi đã upload thành công 1 Year, 3 Months ago Karma: 0  
mình tạo component cho phép đọc file excel(có file reader.php hỗ trợ đọc file excel) - browse chọn file, nhấn upload. Đã upload file lên thành công, nhưng đọc file thì không đọc được? Nhờ các bạn xem giúp giùm.
Các file như sau:
file admin.x_diem.html.php






file admin.x_diem.php
……
switch($task){
case 'upload':
uploadFile();
break;
}

function uploadFile()
{
$target_path = "C://wamp/www/administrator/components/com_upload/uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
echo "File has been uploaded";
$fileType = $_FILES['uploadedfile']['type'];
$fileName = $_FILES['uploadedfile']['name'];
if ($fileType != 'application/vnd.ms-excel'
{
echo 'Please choose file Excel';
exit;
}
else
{ //don't read file Excel: Error
include_once('reader.php';//include the reader class file
$xl_reader = new Spreadsheet_Excel_Reader();//Make an instance of the class
$xl_reader->read($fileName);
$rows = $xl_reader->sheets[0]['numRows'];
$cols = $xl_reader->sheets[0]['numCols'];
echo "Dong: ".$rows.""."Cot: ".$cols."";
}

}
else
echo "Error uploading the file";
}



Error:

File has been uploaded
The filename diemthi.xls is not readable



Component + file excel thử đính kèm
File Attachment:
Please login to download the file!
File Size: 16949
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#842
trucnhi
(User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Trả lời: Không thể đọc được file, sau khi đã upload thành công 1 Year, 3 Months ago Karma: 0  
em đã chỉnh sửa lỗi này dc rồi, làm phiền mấy anh
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop