View Full Version : xuat trang web ra file word
tienhehe
22-12-2008, 11:01
minh dang gap van de xuat trang web ra file word, nhung chua biet lam the nao.
co ai biet chi minh voi.
thanks!
Không biết web bạn sử dụng ngôn ngữ nào (asp.net/c#, php, java ..)
Nếu dùng asp.net/c# thì có thể dùng
--------------------
Response.ContentType = "application/ms-word";
--------------------
Cộng thêm mấy cái class trong System.IO, System.Text
tienhehe
22-12-2008, 12:06
minh viet bang PHP, ban chi giup minh cach xuat ra file word duoc khong?
minh xuat ra duoc file .PDF nhung chua xuat ra duoc file word
thanks ban nhieu!
PHP thì dùng header("Content-type: application/x-ms-download");
xem demo online (http://www.viettri.net.vn/examples/php/export-to-ms-word.php)
<?php
$WorlFileName="viettri-net-vn". ".doc";
header("Content-type: application/x-ms-download");
header("Content-Disposition: attachment; filename=$WorlFileName");
header('Cache-Control: public');
//đoạn nội dung sẽ xuất ra word
echo "welcome to VietTri.net.vn";
?>
tienhehe
23-12-2008, 09:01
cam on ban nhieu nhe
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.