Skip to Content
MOBILE WEB程式設計--第二版
book

MOBILE WEB程式設計--第二版

by Maximiliano Firtman
December 2013
Intermediate to advanced
752 pages
16h
Chinese
GoTop Information, Inc.
Content preview from MOBILE WEB程式設計--第二版
642
|
第十七章
檔案傳遞
檔案傳遞有三種模式:
直接連結。
延遲連結。
OMA 下載。
你可以使用以上任何一種方法來傳送檔案,無論是直接使用實體檔案(視訊、音訊、遊
戲等等),或透過指令碼(PHPASPX 等等)。如果你使用指令碼來傳送檔案,可以在
每次下載時進行記錄、安全保護,甚至收費。如果該檔案是由 Web 伺服器直接提供,所
有人都可以透過 URL 下載檔案。
使用 HTTP 來安裝檔案的過程稱為 OTAover-the-air)佈建。有一些低
階設備雖然沒有瀏覽器,但也可以使用 HTTP 來下載檔案(例如:鈴聲、
應用程式,或圖像)。我們可以為這些設備提供檔案,但是你必須使用
SMS,以 WAP Push 來傳送下載 URL
直接連結
直接連結是最簡單的內容傳送方式。直接連結只是檔案的連結(帶有正確的 MIME 類型
定義)、檔案傳送指令碼的連結,或會將使用者引導至檔案的指令碼。例如:
<a href="game.jad">Download This Game</a>
<a href="download.php?id=22222">Download This Game</a>
download.php
指令碼可以將內容儲存至資料庫、檢查權限,接著使用適當的 MIME 類型
來傳送內容,將檔案寫至回應輸出,或將瀏覽器重新導向檔案:
<?php
if ($everything_ok) {
header('Location: game.jad');
} else {
header('Location: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly

Publisher Resources

ISBN: 9789862769522