Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NTU CCSP 2012Fall - Node.js #2.1 - Simple File ...
Search
Steven Su
October 31, 2012
Programming
2
450
NTU CCSP 2012Fall - Node.js #2.1 - Simple File Host Service
node.js 0.8 + express 3
Steven Su
October 31, 2012
Tweet
Share
More Decks by Steven Su
See All by Steven Su
JSDC.TW 2013 Node.js佈署心得
xpsteven
14
1.2k
NTU CCSP 2012Fall - Mobile Web入門 回首網頁開發
xpsteven
3
290
NTU CCSP 2012Fall - Facebook
xpsteven
1
200
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
720
NTU CCSP 2012Fall - Node.js #2 - express.js
xpsteven
3
560
Y! Open Hack 2012 Taiwan
xpsteven
0
180
NTU CCSP 2012Fall - Node.js #2 - Advanced Javascript and Node.js
xpsteven
1
540
Other Decks in Programming
See All in Programming
CSC307 Lecture 03
javiergs
PRO
1
480
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
180
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
940
Patterns of Patterns
denyspoltorak
0
1.3k
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
2
600
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
530
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
270
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
360
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
170
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
0
730
Between Models and Reality
mayunak
1
180
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
KATA
mclloyd
PRO
34
15k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
87
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
87
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
110
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
920
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Transcript
簡易檔案上傳網站
目標 • 可以上傳檔案並給名稱 • 可以清單顯示已經上傳的檔案 • 可以顯示已經上傳的檔案
環境 • Windows 7 • Sublime Text 2 • Node.js
0.8.x • Express.js 3.0
要求 • 安裝好node 0.8.x • 可以使用npm指令 • 可以使用node指令
Step 0: 安裝express 打開終端機 輸入 npm install express –g -g也可以放install前面
-g代表安裝到global 才可以在任何資料夾當作指 令來使用 簡單說就是安裝程式到系統
Step 0: 安裝express
Step 1: 建立專案 測試express指令
Step 1: 建立專案 express -e -c less -s uploadserver
Step 2: 安裝所需要的庫 npm install 會自動依照目錄下 的package.json安裝所依賴的 套件到目前目錄(local mode)
Step 3: 驗證安裝 node app.js 打開瀏覽器 http://localhost:3000/
Step 4: 打開ST2 以資料夾模式開啟
Step 5: 編輯bodyParser 修改bodyParser keepExtensions => 保留附檔名 uploadDir => 指定上傳到哪個資料夾
Step 6: 接受上傳 var database 模擬一個資料庫 res.redirect(路徑) 回傳302導向其他 網頁
Step 7: 修改index view
Step 8: 測試看看吧
Step 9: 修改index的handler
Step 10: 再修改index.ejs
Step 11: 測試看看