Showing posts with label IT. Show all posts
Showing posts with label IT. Show all posts

Wednesday, October 15, 2008

แสดงไฟล์ pdf ด้วย php

เดี๋ยวนี้ทำพวก coding เยอะ
อย่างเช่นตัวอย่างนี้ เหตุเกิดเพราะว่า จะมีการเรียก pdf ไฟล์จากเครื่อง server อีกเครื่องหนึ่ง โดยที่ไม่ต้องการให้ผู้เรียกใช้งานรู้ว่า file pdf มาจากไหน ก็เลยส่งเป็น request มาให้ เช่น

/searchResearchContent.php?NewsID=12121212&key=12121311AABDDD00

แล้วให้เราส่งเป็น ไฟล์ pdf ออกมา  วิธีการก็ง่าย ๆ แค่ ต้องเข้าใจ Header ก็พอ

-- php --
$filename = "38_file.pdf"; 
header("Cache-Control: public"); 
header("Content-Description: File Transfer"); 
header('Content-disposition: attachment; filename='.basename($filename)); 
header("Content-Type: application/pdf"); 
header("Content-Transfer-Encoding: binary"); 
header('Content-Length: '. filesize($filename)); 
readfile($filename);
-- php --

ในกรณีที่ต้องการให้แสดง pdf ใน Browser ก็แค่เปลี่ยนจาก "Content-disposition: attachment;" เป็น "Content-disposition: inline;" เท่านั้นเอง

Wednesday, September 3, 2008

การบ้าน Globalization or Die

วันนี้ได้มีโอกาสเข้ามาฟังเรื่อง Globalization or Die ที่ Software park ไดัจัดขึ้น วิทยากรได้แสดงให้เห็นถึงภาพรวมของระบบ Software ในด้านของการตลาด เพื่อที่จะนำ Software จากฝีมือคนไทยไปสู่ตลาดโลก

ใช่ครับเขียนไม่ผิด ซอฟต์แวร์ไทยไปสู่ตลาดโลก แต่วันนี้เน้นไปที่เวียดนามหน่อย

วิทยากรได้แสดงภาพประกอบอย่างน่าสนใจ ดังนั้นจึงนำความรู้วันนี้มาเขียนเป็นโครงการเพื่อใช้เป็นแนวทางในการพัฒนาต่อไป

Project: 
Global Travel

Overview: 
Community for all to share the places they had seen and their experience, e.g. Place of Traveling. And try to answer these questions:
  1. Have you ever been there?
  2. How to be there?
  3. What are the most place to visit for this trip?
  4. When should i visit there?
  5. Please show me the pictures or videos.
Target: 
Sure! Thailand first, then anywhere can see on Google Map.

Business Side: 
Off cause Free. Then Business partners, They will need to locate their location on the map where traveller pass. Like Gas Station, Restaurant, Hotel, Hospital.

Functional:
User locate the place by Google Map, then add their experience e.g. blog, trip, photos, video from Google Applications Service.
Then Other can vote that reviews 

Business Partner can add their location and other service. Example, Hospitality service, Food, Fuel, Convenient Store.

Platform:
Google App Engine, Web, Mobile, Python

Others:


ขั้นตอนต่อไปคือศึกษาความเป็นไปได้